403 error when trying to search twitter, Processing, Twitter4j, controlP5 -
when executing twitter query 403 error, error message below, other queries work , executed prior one, can spot may wrong here:
twitter exception: twitterexception{exceptioncode=[f3acd3ed-00581fa3], statuscode=403, retryafter=0, ratelimitstatus=null, version=2.1.5-snapshot(build: d372a51b9b419cbd73d416474f4a855f3e889507)}
this occurs when execute search app, im not overdoing limits can execute other searches one, appreciated, code listed below. im using combination of twitter4j , processing controlp5 handle input search.
void setup(){ ... cp5.addtextfield("search") .setposition(30,20) .setsize(100,20) .setfocus(true) .setcolor(color(255,0,0)) .setgroup(g2) ; } public void search(string thetext) { qm.srch = true; qm.thetext = thetext; qm.usersearch(); qm.srch = false; // automatically receives results controller input println("a textfield event controller 'input' : "+thetext); } void usersearch() { try { if (srch) { configurationbuilder cb9 = new configurationbuilder(); cb9.setoauthconsumerkey("xxxxxxxxxxxxxxxxxxxxxx"); cb9.setoauthconsumersecret("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); cb9.setoauthaccesstoken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); cb9.setoauthaccesstokensecret("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); println("connected"); twitter twitter = new twitterfactory(cb9.build()).getinstance(); query srchh = new query(thetext2); srchh.setrpp(5); queryresult srchhres = twitter.search(srchh); arraylist srchhtwe = (arraylist) srchhres.gettweets(); (int = 0; < srchhtwe.size(); i++) { tweet t = (tweet) srchhtwe.get(i); string user = t.getfromuser(); geolocation l = t.getgeolocation(); string locnam = t.getlocation(); string msg = t.gettext(); wholetweetsl.add(msg); println("\nmessage: " + msg); println("\nlocation: " + locnam); } } } catch(twitterexception e) { println("twitter exception: " + e); } }
from twitter @ https://dev.twitter.com/docs/error-codes-responses
403 forbidden request understood, has been refused or access not allowed. accompanying error message explain why. code used when requests being denied due update limits.
Comments
Post a Comment