A friend of mine asked for a way to find the first occurrence of a certain hashtag on twitter, within the search criteria limited by twitter of course (a search can’t yield more than 1500 tweets, only 3000 tweets are maintained per user), so I built a mini app using twitter4j API to search for these tweets and acquires the oldest, not that different from searching on twitter and flipping through the pages till you find the oldest tweet, but much more convenient as you run the command feeding it the hashtag and you get the result, so now i had the application however had no way for my friend to use it.
at that point I started downloading netbeans with J2EE support, this would allow me to turn this application to a servlet, or a JSP of some sort, however as i was downloading it occurred to me that i can use twitter its self for communication.
The current use case is:
- Friend wants the oldest available occurrence of hashtag #bateekha.
- Friend mentions my twitter bot account, and uses a keyword followed by #bateekha.
- twitter bot checks mentions with that keyword every 1 minute.
- once keyword is found, #bateekha is parsed out, searched for and original tweet retweeted.
- Friend finds out that original tweet.
Later on i’m going to extend this project by increasing the number of keyword, maintaining a database and compiling an authorised users list.
Done, a service is up and running, the account is La2eely.
to have it find you results for you just type in @la2eely 2a2dam #bateekha