[Sharing] Mxj maxtwitter – search,geoSearch and posting to twitter

Oct 11, 2011 at 6:03pm

[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,

  1. MaxTwitter1.01.RAR
Oct 11, 2011 at 6:05pm

Just found this


Nice pictures showing how to register the application

Feb 6, 2012 at 11:45am

thanks for sharing!!
do you known how to search a word with a geolocation ?
i trying to search an area for word


Feb 6, 2012 at 7:54pm

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.


Feb 8, 2012 at 6:43pm

That tinkerlondon sites gives red flag malware warnings in both firefox and chrome..

Feb 8, 2012 at 7:55pm

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.


Feb 22, 2012 at 4:42am

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…

– Pasted Max Patch, click to expand. –


Feb 23, 2012 at 3:18pm

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


Feb 23, 2012 at 7:47pm

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.


(Is anybody experiencing trouble posting tweets? I can’t seem to post anymore)



Feb 23, 2012 at 9:33pm

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

Feb 23, 2012 at 11:17pm

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.


Feb 25, 2012 at 1:16am

FRid: I’ll be waiting eagerly, then :) Looking to do twitter control of a visuals patch in just over 7 days.

Feb 25, 2012 at 2:08am

that would be amazing!!

Mar 1, 2012 at 8:32am

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 -)

Mar 1, 2012 at 2:32pm

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.


  1. Maxtwitter1.01.RAR
Mar 8, 2012 at 12:12am

Yay, i got the threads up and running. New feature is a bang out the right outlet when searching/geosearching is done.


  1. Maxtwitter1.02.RAR
May 3, 2012 at 8:16pm

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’

May 4, 2012 at 12:11am

try to update your jdk/jre. Apparently you’re using an older version of java to run this.




Jul 3, 2012 at 10:26pm

do i have to update to lion for this?


You must be logged in to reply to this topic.