I'm having trouble getting the User-agent from the following robots.txt which is contained in the $robotstxt variable:
User-agent: *
Disallow: /
Here's the code I'm using:
<$robotsch="multiple
recdelim \x0a=[\x20\x09]*\x0d?\x0a
allmatch \x0a
field Agent varchar User-agent ''
field Disallow varchar Disallow ''
">
<timport row $robotsch $robotstxt><!-- parse the file -->
agent:$Agent
dis: $Disallow
<local xa="">
<lower $Agent><$Agent=$ret><!-- work in lowercase -->
<split "\x0d?>>\x0a" $Agent><!-- break out multiples -->
<sandr "\space+>>=" "" $ret>
<loop $ret><!-- for each agent -->
<if $ret eq $myname or $ret eq "*"><!-- for me or anyone -->
<$xa=$ret><break><!-- something i should look at -->
</if>
</loop>
<if $xa ne "">
<$Agent=$xa><!-- matching agent name -->
<$rrejects=><!-- clear any previous matches -->
<$rrejectssrc=>
<split "\x0d?>>\x0a" $Disallow><!-- break out multiples -->
<$dislist=$ret>
<loop $dislist><!-- for each disallow -->
<rex ">>=[^ #*]+" $dislist><!-- truncate at incorrect usage -->
</loop>
</if>
</timport>
The $Agent variable never returns the *.
User-agent: *
Disallow: /
Here's the code I'm using:
<$robotsch="multiple
recdelim \x0a=[\x20\x09]*\x0d?\x0a
allmatch \x0a
field Agent varchar User-agent ''
field Disallow varchar Disallow ''
">
<timport row $robotsch $robotstxt><!-- parse the file -->
agent:$Agent
dis: $Disallow
<local xa="">
<lower $Agent><$Agent=$ret><!-- work in lowercase -->
<split "\x0d?>>\x0a" $Agent><!-- break out multiples -->
<sandr "\space+>>=" "" $ret>
<loop $ret><!-- for each agent -->
<if $ret eq $myname or $ret eq "*"><!-- for me or anyone -->
<$xa=$ret><break><!-- something i should look at -->
</if>
</loop>
<if $xa ne "">
<$Agent=$xa><!-- matching agent name -->
<$rrejects=><!-- clear any previous matches -->
<$rrejectssrc=>
<split "\x0d?>>\x0a" $Disallow><!-- break out multiples -->
<$dislist=$ret>
<loop $dislist><!-- for each disallow -->
<rex ">>=[^ #*]+" $dislist><!-- truncate at incorrect usage -->
</loop>
</if>
</timport>
The $Agent variable never returns the *.