Hi! I know you are probably asking what the heck is he doing? I will be honest here, this is not a tutorial but a simple quick fix to a problem I faced last night. I was invited by an author to take part in the so called blog hopping. One of the requirements was to find at least five other authors with blogs to join the adventure. So, I asked myself, how could I make this as much fun as possible and learn something at the same time?
Let us learn how to use github public repository.This happens to be my last post on this Programming With Twitter API journey. I do not feel sad because this is actually just the beginning! I will not stop here, I will keep making something better out of it. This has been a great adventure, very informing and fun. So, without much a do, I want to show you(if you have not done this before), how to make our code publicly accessible to interested people who want to read it and even use it for their own learning or applications. I am going straight to github – by the way this is not the only one, look for bitbucket or something that makes you happy.
So, we are almost at the end of the journey here and I am so excited to do so. In my previous post, I demonstrated how to pick up the pieces from the returned data and put them into a single file. That was easy right?
The problem is that if someone else wanted to use my code, they would have to change parts of the code every time, which is not very smart! Today, I am going to put our code together, encapsulate it in a function that will take one parameter from the user and perform the tricks behind the scenes and boom, you get clean tweets containing the query keyword you entered. I know, I should stop talking and show you what I did:
Today, I am going to explore farther or deeper into what we can do with what Twitter API calls returns to us. I will make the whole post a step-by-step tutorial so that anyone interested in trying the codes out can do so with ease. So, let us get started.
#Always remember to use comments when writing code
#since we are using Python as our programming language
#of choice, we will make sure to import the necessary
#modules or libraries into our file
In this challenge, we are required to perform some data parsing using JSON methods. Since I am going to use Python, I will be importing some libraries into my file and then make some real API calls to Twitter instead of using the provided JSON data.
I am going to do several things and still make this post as short as possible!
#perform some data parsing using json.
#make api calls to twitter servers
#### mozilla challenge – programming with twitter api
import urllib2 #python module for handling urls
import json #json anyone??
url = ‘http://api.twitter.com/1/statuses/user_timeline/eenvincible.json’
#make a simple dictionary/hash, add some items to it
#experiment on retrieving them by key and by value
#dictionaries are mutable
Hello everyone! I am back again with another challenge from Mozilla P2PU. I just couldn’t wait because completing the first one made me so dang excited! This post is an introductory one, meaning I will not be writing any code today. I will consider this a preparation for the real thing.
While I was getting things ready for the journey ahead, I ran around the web like a bot trying to gather all the necessary documentation and I spent a good amount of time on Twitter’s Developers page scheming through their updated APIs. Below are just a few I had to grab!