[Sharing] Mxj maxtwitter - search,geoSearch and posting to twitter
Hello peoples,
Not much more than the title really. Usage relies heavily on twitter4j, a java-client for twitter so all credits go to them for bridging it to java. Example-file attached will get you started. You will need to have a twitter account and create a new application though but that's really simple and quickly done.
Happy patching,
FRid
Just found this
Nice pictures showing how to register the application
thanks for sharing!!
do you known how to search a word with a geolocation ?
i trying to search an area for word
thanks
Ben
Hi Ben,
I may misunderstand but i think there are two ways for this, either you search for a word and match the resulting locations to the desired ones (set up bounds for the geolocation) or geosearch a location and look for a match in the returned tweets.
HTH,
FRid
That tinkerlondon sites gives red flag malware warnings in both firefox and chrome..
Thanks for letting me know. I'm getting the same warning on firefox.
I've found another site with pictures showing what to do but i must say it look's a little too similar so also probably not trustworthy. If you want too i can post the link but i think the process is pretty self-explanatory.
FRid
Are any of you guys experiencing any kind of lag in getting the search results from twitter?
It seems to come in waves. I'm using 'SEX' as a search result, it seems pretty common. ;)
Included is my patch in case something is going on there...
`
hi FRid
sorry for the long time, and thanks for your replay<
yes i want to set up the bounds for the geolocation, for example search all around manchester for the word hate,
is that possible?
@nightrider, yes it does sent to come in waves on my computer too, no idea why
thanks
Ben
Hi guys,
What do you exactly mean by waves? You do know about rate-limiting i presume? You only have 150 requests per hour so checking every two seconds will have you exceed that quite fast. Try setting the results higher and the searchfrequency lower (30 sec.).
About the searchresults, it is kinda bummed the search will not return geolocations to the searchterm (although i did write that in) I suggest geosearching Manchester for all tweets and then use regexp to look for hate and ditch all the other messages.
FRid
(Is anybody experiencing trouble posting tweets? I can't seem to post anymore)
Rate-limiting-
https://dev.twitter.com/docs/rate-limiting
thanks will have a go at doing that, but will also have a go at the java and see if i can figure it out
Posting does seem to work, i just had to connect the "post"-message. Other good news is that i've finally been able to use a new trick and instead of a maximum of 100 tweets i can now search for a maximum of 1500! I had this working in processing for a while but i never managed to do the same thing in max untill now that is.
So if you have a couple of days i'll post an update. I'll also try to get it working in a seperate thread so it won't freeze max anymore when searching, use another way to seperate the results so text can easily be seperated from the rest of the data and i'll take another look at the missing geolocations when searching for a word.
FRid
FRid: I'll be waiting eagerly, then :) Looking to do twitter control of a visuals patch in just over 7 days.
that would be amazing!!
Hi FRid
have you had any luck with the update? i have been trying to change the java, but i just seem to break it
lots of thanks Ben -)
Hi guys,
Unfortunately it's all work and no play the last couple of days so it's not really ready yet, i still need to look into the threads but you can search for a lot more tweets now.
Instead of "maxtwitter" it's now called "Maxtwitter". This was because of Netbeans wanting classes to start with a capital letter and make sure you delete the old maxtwitter.class/.java and .maxhelp before copying this in to avoid conflicts.
The missing geo-locations in the search-function are still a mystery to me, i'm guessing it won't let me see the locations if they are outside my own country, if anyone can confirm this behaviour (or otherwise) please let me know.
Returned tweets are now seperated by "" this should make it easier to extract data from the results. Because i suck at regexp and time is not on my side i've not yet created an example of this but i'm sure you'll figure it out.
So happy patching and i'll post an update soon when i get the threads working.
FRid
Hi, I´m having some problems to use the external. It seems that the Java version doesn´t work, it happens both in Max 5 and Max &
java.lang.UnsupportedClassVersionError: Maxtwitter : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at com.cycling74.max.MXJClassLoaderImpl.doLoadClass(MXJClassLoaderImpl.java:119)
at com.cycling74.max.MXJClassLoader.loadClazz(MXJClassLoader.java:88)
Could not load class 'Maxtwitter'
try to update your jdk/jre. Apparently you're using an older version of java to run this.
HTH,
FRid
do i have to update to lion for this?