Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Un-fixed bugs reported on PB forums finder thing
- EnableExplicit
- InitNetwork()
- Dim fmz.s(3,1)
- fmz(0,0)="4"
- fmz(0,1)="Windows Bugs"
- fmz(1,0)="23"
- fmz(1,1)="Linux Bugs"
- fmz(2,0)="24"
- fmz(2,1)="OSX Bugs"
- fmz(3,0)="37"
- fmz(3,1)="Doc Bugs"
- Define look.l=30,i.l=0,ii.l=0,*buffer,html$,posts.l
- Declare unsolved(html$)
- Debug "<html><header></header><body style="+Chr(34)+"background-color:#000;color:#0f0;"+Chr(34)+">"
- For i = 0 To ArraySize(fmz())
- Debug "<h1>"+fmz(i,1)+"</h1>"
- *buffer=ReceiveHTTPMemory("http://www.purebasic.fr/english/viewforum.php?f="+fmz(i,0))
- If *buffer
- html$=PeekS(*buffer,MemorySize(*buffer),#PB_UTF8)
- FreeMemory(*buffer)
- unsolved(html$)
- ;get thread count
- For ii=3000 To 0 Step -1
- If CountString(html$,"&start="+Str(ii))>0
- posts=ii+30
- Break
- EndIf
- Next
- ;paginate
- Repeat
- *buffer=ReceiveHTTPMemory("http://www.purebasic.fr/english/viewforum.php?f="+fmz(i,0)+"&start="+Str(look))
- If *buffer
- html$=PeekS(*buffer,MemorySize(*buffer),#PB_UTF8)
- FreeMemory(*buffer)
- unsolved(html$)
- Else
- Break
- EndIf
- look=look+30
- If look>posts : Break : EndIf
- Delay(Random(15000,5000))
- ForEver
- look=30 : posts=0
- EndIf
- Next
- Debug "</body></html>"
- End
- Procedure unsolved(html$)
- Protected title.s
- Protected url.s
- Protected pos.l
- Repeat
- pos=FindString(html$,"topictitle",pos+1)
- If Not pos : Break : EndIf
- title=Mid(html$,pos+12,FindString(html$,"<",pos+12)-(pos+12))
- url=Mid(html$,FindString(html$,"href="+Chr(34),pos-100)+6,FindString(html$,Chr(34),(FindString(html$,"href="+Chr(34),pos-100)+6))-(FindString(html$,"href="+Chr(34),pos-100)+6))
- url=ReplaceString(url,"&","&")
- url=ReplaceString(url,"./","http://www.purebasic.fr/english/")
- If CountString(url,"&sid=")>0 : url=ReplaceString(url,Mid(url,FindString(url,"&sid="),37),"") : EndIf
- If CountString(title,"Done")=0 And CountString(title,"done")=0
- Debug "<a href="+Chr(34)+url+Chr(34)+">"+title+"</a><br>"
- EndIf
- title="" : url=""
- ForEver
- EndProcedure
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement