Monovski 4 Posted February 20, 2015 Report Share Posted February 20, 2015 I try to create code to post comment using plugin but not sure why failed sample code: set(#GET URL,"http://smpn1sikur.sch.id/halkomentar-156-smp-negeri-1-sikur-raih-1.html","Global")set(#Post,$plugin function("HTTP post.dll", "$http post", #GET URL, "id=156-smp-negeri-1-sikur-raih-tingkat&nama_komentar=smpnsukur&url=smpnsukur.com&isi_komentar=sukurin&kode={$solve captcha(<src="captcha.php">)}&submit=Kirim", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0", "http://smpn1sikur.sch.id/halkomentar-156-smp-negeri-1-sikur-raih-1.html", "", ""),"Global") the sample http header in attach files please helphttp header.txt Quote Link to post Share on other sites
Bot-Factory 602 Posted February 20, 2015 Report Share Posted February 20, 2015 What's the exact error? Quote Link to post Share on other sites
Monovski 4 Posted February 20, 2015 Report Share Posted February 20, 2015 Cant post i still confuse with captha thanks dan Quote Link to post Share on other sites
Bot-Factory 602 Posted February 20, 2015 Report Share Posted February 20, 2015 I'll post an example when I'm back at my computer. Quote Link to post Share on other sites
Aymen 385 Posted February 20, 2015 Author Report Share Posted February 20, 2015 I try to create code to post comment using plugin but not sure why failed sample code: set(#GET URL,"http://smpn1sikur.sch.id/halkomentar-156-smp-negeri-1-sikur-raih-1.html","Global")set(#Post,$plugin function("HTTP post.dll", "$http post", #GET URL, "id=156-smp-negeri-1-sikur-raih-tingkat&nama_komentar=smpnsukur&url=smpnsukur.com&isi_komentar=sukurin&kode={$solve captcha(<src="captcha.php">)}&submit=Kirim", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0", "http://smpn1sikur.sch.id/halkomentar-156-smp-negeri-1-sikur-raih-1.html", "", ""),"Global") the sample http header in attach files please help you can't use ubot captcha solving function , it only works with a browser , use can use http captcha dialog Quote Link to post Share on other sites
Bot-Factory 602 Posted February 20, 2015 Report Share Posted February 20, 2015 So, here's the example code I promised: set(#get,$plugin function("HTTP post.dll", "$http get", "http://smpn1sikur.sch.id/halkomentar-156-smp-negeri-1-sikur-raih-1.html", $plugin function("HTTP post.dll", "$http useragent string", "IE 11.0 Win7 64-bit"), "http://smpn1sikur.sch.id", "", 60),"Global")plugin command("HTTP post.dll", "http file download", "http://smpn1sikur.sch.id/captcha.php", "d:\\x.jpg", "")set(#captcha,$plugin function("HTTP post.dll", "$http captcha dialog", "d:\\x.jpg"),"Global")set(#namakomentar,"Test123","Global")set(#url,"websitexx","Global")set(#isikomentar,"kommentaxx","Global")set(#post,$plugin function("HTTP post.dll", "$http post", "http://smpn1sikur.sch.id/simpankomentar.php", "id=156-smp-negeri-1-sikur-raih&nama_komentar={#namakomentar}&url={#url}&isi_komentar={#isikomentar}&kode={#captcha}&submit=Kirim", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36", "http://smpn1sikur.sch.id/halkomentar-156-smp-negeri-1-sikur-raih-1.html", "", 60),"Global")load html(#post) And if you need some additional HTTP plugin tutorials, take a look at my site Quote Link to post Share on other sites
HelloInsomnia 1103 Posted February 21, 2015 Report Share Posted February 21, 2015 Aymen can you add in url path and url query much like the url hostname, so for: http://www.nytimes.com/2015/02/21/business/international/greece-debt-eurozone-finance-ministers.html?hp&action=click&pgtype=Homepage&module=first-column-region®ion=top-news&WT.nav=top-news&_r=0 Hostname = www.nytimes.comPath = /2015/02/21/business/international/greece-debt-eurozone-finance-ministers.htmlQuery = ?hp&action=click&pgtype=Homepage&module=first-column-region®ion=top-news&WT.nav=top-news&_r=0 That would be very helpful 1 Quote Link to post Share on other sites
Monovski 4 Posted February 21, 2015 Report Share Posted February 21, 2015 Hi Dan thanks for help, I still have question, How if the parameter always change? e.g in site A paremeter like this: id=13-latihan-toilet-untuk-anak-lakilaki-&nama_komentar=amsyong&url=http%3A%2F%2Famsyong.com&isi_komentar=amsyonh+aja&kode=4c617e&submit=Kirim in site B parameter like this: id=156-smp-negeri-1-sikur-raih-tingkat&nama_komentar=smpnsukur&url=smpnsukur.com&isi_komentar=sukurin&kode=b390c2&submit=Kirim is it mean we should use regex? thanks Dan I bookmark your website as well Quote Link to post Share on other sites
Bot-Factory 602 Posted February 21, 2015 Report Share Posted February 21, 2015 Nick, Why is that not possible today? If that is a get or post request you can construct the urls via variables already?But I might not understand it correctly. Dan Quote Link to post Share on other sites
HelloInsomnia 1103 Posted February 21, 2015 Report Share Posted February 21, 2015 Nick, Why is that not possible today? If that is a get or post request you can construct the urls via variables already?But I might not understand it correctly. Dan It's just already built into C# and not into Ubot and it would be nice to separate them for certain things like website crawlers It can be done in other ways of course though. Quote Link to post Share on other sites
Bot-Factory 602 Posted February 21, 2015 Report Share Posted February 21, 2015 Ah ok. I was just wondering if there is a special usecase that is currently not supported. But now I understand. Quote Link to post Share on other sites
Bot-Factory 602 Posted February 21, 2015 Report Share Posted February 21, 2015 Aymen, could you add a clear all cookies command?Or something that rests everything but works in a loop without threading and can be called multiple times?Reset object doesn't work in that case. ThanksDan Quote Link to post Share on other sites
Monovski 4 Posted February 22, 2015 Report Share Posted February 22, 2015 Hi Dan, Can we scrape parameter with ubot? I have problem and need help ragarding diferent parameter for every page, sample: in site A paremeter like this: id=13-latihan-toilet-untuk-anak-lakilaki-&nama_komentar=amsyong&url=http%3A%2F%2Famsyong.com&isi_komentar=amsyonh+aja&kode=4c617e&submit=Kirim in site B parameter like this: id=156-smp-negeri-1-sikur-raih-tingkat&nama_komentar=smpnsukur&url=smpnsukur.com&isi_komentar=sukurin&kode=b390c2&submit=Kirim and I also already create regex id=\d+([A-Za-z0-9-]+) for string: id=13-latihan-toilet-untuk-anak-lakilaki-id=156-smp-negeri-1-sikur-raih-tingkat I only need to find how we scrape the paramter above and implement in ubot: so far I create code like this but not work set(#Param1,"id=143--home-spesiatest-antivirus-terbaik-20122013-avtest&nama_komentar=madrox&url=madrox.co&isi_komentar=komen+madrox&kode=6a1d12&submit=Kirim","Global")set(#Param2,$find regular expression(#Param1,"id=\\d+([A-Za-z0-9-]+)"),"Global") Quote Link to post Share on other sites
Bot-Factory 602 Posted February 22, 2015 Report Share Posted February 22, 2015 Monovski, you can use regex or xpath to scrape stuff from the html code. Which one is better depends on what you want to extract from the page. There is no generic way to do things. You have to adjust your approach to the goal you have. If you scrape two different sites who need different parameters, you need different code. It's not always possible to have generic code that supports multiple scenarios. Dan 1 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted February 22, 2015 Report Share Posted February 22, 2015 Monovski, you can use regex or xpath to scrape stuff from the html code. Which one is better depends on what you want to extract from the page. There is no generic way to do things. You have to adjust your approach to the goal you have. If you scrape two different sites who need different parameters, you need different code. It's not always possible to have generic code that supports multiple scenarios. Dan Pretty much what Dan said ^^ but I will point out that those are id's and generally that means xpath is the way to go (but not always like Dan said). Quote Link to post Share on other sites
Monovski 4 Posted February 22, 2015 Report Share Posted February 22, 2015 hmmm.. If you scrape two different sites who need different parameters, you need different code. It's not always possible to have generic code that supports multiple scenarios. with other word there's no other way or very limit, when we using the http post plugin to post in websites that has diferent parameter? Quote Link to post Share on other sites
Bot-Factory 602 Posted February 22, 2015 Report Share Posted February 22, 2015 You can post to almost every website of course. But your script needs to know what to do. How should it know which parameters are used by a site? It can't guess it :-)And even if parameter names are identical. They are not always used for the same thing. I mean that's the reason why those social media bots have to be updated every week. They need to be optimized and configured for every site they support. Dan Quote Link to post Share on other sites
Monovski 4 Posted February 24, 2015 Report Share Posted February 24, 2015 Hi Dan, Thanks for answer BTW how to use GSA Captcha Breaker within http post plugin? I already try but failed Quote Link to post Share on other sites
Aymen 385 Posted February 24, 2015 Author Report Share Posted February 24, 2015 Http Post Update 2.5.6-Added http method command to change http request methodsFixed couple of bugsMerged some commands and functions in single commands/functions to optimize the plugin (see info below)PS: make sure you read the info below before you update as the changes may brake your current script 1)The Commandshttp serialize cookieshttp deserialize cookiesreplaced by a single command http cookies serializer2)The Commandshttp set content typehttp accept encodinghttp accept charsetreplaced by a single command http settings headers3)The functions :http response headershttp response urihttp response statushttp cookies responsereplaced by a single http response function4)The functions :base64 encodebase64 decodehtml encodehtml decodeurl encodeurl decodereplaced by http text encoder function Quote Link to post Share on other sites
Bot-Factory 602 Posted February 24, 2015 Report Share Posted February 24, 2015 Hello Aymen, thanks a lot for the update. Does require some work because of the changed commands / functions, but that's ok :-) Could you please give us some details about "Fixed couple of bugs". What errors did you find and what exactly did you fix? Will give it a try later today to see if the cookies issue is fixed completely now. Dan Quote Link to post Share on other sites
Monovski 4 Posted February 24, 2015 Report Share Posted February 24, 2015 how to download new update? Quote Link to post Share on other sites
Bot-Factory 602 Posted February 24, 2015 Report Share Posted February 24, 2015 You should have received an email. Quote Link to post Share on other sites
Monovski 4 Posted February 24, 2015 Report Share Posted February 24, 2015 not yet Dan but anyway I'll be wait I found the answer my question above here http://docu.gsa-online.de/captcha_breaker Quote Link to post Share on other sites
Bot-Factory 602 Posted February 26, 2015 Report Share Posted February 26, 2015 Http Post Update 2.5.6 -Added http method command to change http request methodsFixed couple of bugsMerged some commands and functions in single commands/functions to optimize the plugin (see info below)PS: make sure you read the info below before you update as the changes may brake your current script 1)The Commands http serialize cookieshttp deserialize cookies replaced by a single command http cookies serializer 2)The Commands http set content typehttp accept encodinghttp accept charset replaced by a single command http settings headers 3)The functions :http response headershttp response urihttp response statushttp cookies response replaced by a single http response function 4)The functions : base64 encodebase64 decodehtml encodehtml decodeurl encodeurl decode replaced by http text encoder function Aymen, could you please give us some details on what bugs you have fixed? Thanks in advance for your reply.Dan Quote Link to post Share on other sites
Aymen 385 Posted February 28, 2015 Author Report Share Posted February 28, 2015 Aymen, could you please give us some details on what bugs you have fixed? Thanks in advance for your reply.Dan fixed this bug http://bugs.ubot-plugins.com/view.php?id=22and couple of other commands/functions with similar errors Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.