A simple python script to find bloggers on twitter

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?

How To Use Github Public Repository

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.

The Force Is Strong With This One

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:

Patience, Young Padawan – More Code

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.

[python]

#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

import urllib2
import json

[/python]

Hone Your Powers – Part 2 (JSON)

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!

[python]
#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’

Hone Your Powers – Programming 101

In this challenge, we are required to learn some basic python or ruby constructs that could be useful while converting data returned by Twitter API calls into useful information that we can use in applications. Of course we don’t have to use either of those languages. There are other great languages like Javascript and PHP that you could give a shot! Either way, let us start this ball rolling: I am going with Python!

[python]

#make a simple dictionary/hash, add some items to it
#experiment on retrieving them by key and by value
#dictionaries are mutable

Programming With Twitter API – P2PU Challenge 2

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!