Forums > MaxMSP

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

October 11, 2011 | 6:03 pm

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

Attachments:
  1. MaxTwitter1.01.RAR

October 11, 2011 | 6:05 pm

Just found this

http://tinkerlondon.com/now/2010/09/14/oauth-twitter-and-processing/

Nice pictures showing how to register the application


February 6, 2012 | 11:45 am

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

thanks
Ben


February 6, 2012 | 7:54 pm

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


February 8, 2012 | 6:43 pm

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


February 8, 2012 | 7:55 pm

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


February 22, 2012 | 4:42 am

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. –

`


February 23, 2012 | 3:18 pm

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


February 23, 2012 | 7:47 pm

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


February 23, 2012 | 9:33 pm

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


February 23, 2012 | 11:17 pm

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


February 25, 2012 | 1:16 am

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


February 25, 2012 | 2:08 am

that would be amazing!!


March 1, 2012 | 8:32 am

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


March 1, 2012 | 2:32 pm

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

Attachments:
  1. Maxtwitter1.01.RAR

March 8, 2012 | 12:12 am

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

FRid

Attachments:
  1. Maxtwitter1.02.RAR

May 3, 2012 | 8:16 pm

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 | 12:11 am

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

HTH,
FRid

https://encrypted.google.com/search?q=Unsupported+major.minor+version+51.0

http://cycling74.com/forums/topic.php?id=38391


July 3, 2012 | 10:26 pm

do i have to update to lion for this?


Viewing 19 posts - 1 through 19 (of 19 total)