I am using java with the twitter search api to store tweets in mongoDB, is there a way to store the json from the twitter api as is?
I am also considering using python, is there a way doing it in python?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t know if you are still interested in an answer to this but from a purely python standing this is how I store the raw tweet json:
to run this just: “python myscript.py –username yourusername –password yourpassword –outputfilename yourpathandfilename”
You’ll need tweetstream argparse gzip json and ast modules installed. All of which can be installed through pip or easy_install or most ubuntu/fedora package managers.
The output file the script will create is a simple gzip compressed text file where each line is a new json string containing the complete tweet json object. Since the script runs until you hit your rate limit, it doesn’t close the gzip file with a proper EOF. However python doesn’t care so you can open it with another script, nor does 7zip or winrar.
I hope that helps. 🙂