Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FapoUploader
#1
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
Code:
Copy      Help
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.


Attached Files
.qml   fapomatic_test.qml (Size: 6.14 KB / Downloads: 331)
pi
#2
It works. Result:

[Image: tab4.png]

Make sure that the comments in the macro don't contain empty lines, ie without a space character.
#3
have you tested the FapoUploader function (as exe or shortcut) ?
out result shows the html code, but findrx (bbcode) does not work.
pi
#4
Did not test. One possible reason is that the HTML maybe contains [10] instead of [].
#5
you are right, with [10] it works.
thanks.
pi


Forum Jump:


Users browsing this thread: 1 Guest(s)