alias parseprofile {
bread test.txt 0 $file(test.txt) &data
var %pointer = $bfind(&data,1,profile.php?id=), %profile, %profileimage, %profiletitle, %profileprice, %profilebling, %profilehotties, %profilebuyfor
while (%pointer) {
if ($bfind(&data,%pointer,")) {
%profile = $bvar(&data,$+(%pointer,-,$calc($v1 - 1))).text
%pointer = $v1 + 1
}
%pointer = $bfind(&data,%pointer,src="http://profile.) + 5
if ($bfind(&data,%pointer,")) {
%profileimage = $bvar(&data,$+(%pointer,-,$calc($v1 - 1))).text
%pointer = $v1
}
%pointer = $bfind(&data,%pointer,title=") + 7
if ($bfind(&data,%pointer,")) {
%profiletitle = $bvar(&data,$+(%pointer,-,$calc($v1 - 1))).text
%pointer = $v1
}
%pointer = $bfind(&data,%pointer,Price:)
%pointer = $bfind(&data,%pointer,$)
if ($bfind(&data,%pointer,<)) {
%profileprice = $bvar(&data,$+(%pointer,-,$calc($v1 - 1))).text
%pointer = $v1
}
%pointer = $bfind(&data,%pointer,Bling:)
%pointer = $bfind(&data,%pointer,$)
if ($bfind(&data,%pointer,<)) {
%profilebling = $bvar(&data,$+(%pointer,-,$calc($v1 - 1))).text
%pointer = $v1
}
%pointer = $bfind(&data,%pointer,Hotties:)
%pointer = $bfind(&data,%pointer,red;">) + 6
if ($bfind(&data,%pointer,<)) {
%profilehotties = $bvar(&data,$+(%pointer,-,$calc($v1 - 1))).text
%pointer = $v1
}
%pointer = $bfind(&data,%pointer,Buy for)
%pointer = $bfind(&data,%pointer,$)
if ($bfind(&data,%pointer,<)) {
%profilebuyfor = $bvar(&data,$+(%pointer,-,$calc($v1 - 1))).text
%pointer = $v1
}
echo -a * Profile: %profile
echo -a * Profile image: %profileimage
echo -a * Profile title: %profiletitle
echo -a * Profile price: %profileprice
echo -a * Profile bling: %profilebling
echo -a * Profile hotties: %profilehotties
echo -a * Profile buy for: %profilebuyfor
%pointer = $bfind(&data,%pointer,profile.php?id=)
}
}