11-09-2007, 09:04 PM
I work on a small exe for uploading images to fapomatic.com .
Upload works quite well, but i have difficulties to extract the resulting bbcode.
FapoUploader
when testing the result pasted into another macro i get the bbcode.
Upload works quite well, but i have difficulties to extract the resulting bbcode.
FapoUploader
str src=_command
src.findreplace("''" "")
str ext.GetFileExt(src)
sel ext 1
,case ["jpg","jpeg","png","gif"]
,,goto upload
,case else
,,out "no valid extension"
,,end
,,
;upload
str domain="http://fapomatic.com"
str result
ARRAY(POSTFIELD) a.create(1)
a[0].name="userfile"; a[0].value=src; a[0].isfile=1
Http h.Connect(domain)
if(!h.PostFormData("upload.php" a result)) end "failed"
result.setfile("$desktop$\result.htm")
run "$desktop$\result.htm"
str bbcode
if(findrx(result "(?s)(?<=''select4'' cols=75 rows=2>[]).+(?=</textarea>[]<br>)" 0 1 bbcode)<0) ret
;bbcode.setclip
out bbcode
when testing the result pasted into another macro i get the bbcode.