In the earlier post we saw the need for OAuth. Let me explain it a little more.
Steve wants to get some money from his bank account. He calls his son Bob, gives him his Visa Card and the pin number and asks him to withdraw some money for him from the ATM. Don’t you think Steve is taking a risk here?
Now imagine yourself giving your twitter username and password to a third party application so that they can tweet about your blog article on your behalf. Dont you think you are taking a risk here, just like Steve?
A better solution for Steve would be that he writes a cheque for the exact amount needed, puts his signature in the cheque and asks Bob to encash it from the bank. Now we all agree this is a far safer approach. This ensures that:
Similary instead of giving our credentials to a third party application, we can ask twitter to give the third party application an encrypted information ( or token ) of our twitter identity with restricted priviledges. This ensures that:
So, did you finally get how OAuth works? In my next post I will talk about how to use OAuth with Twitter.
But before I get into what I did, let me give you a background on what it takes a python code to talk to twitter.
Many times we tweet or like or share content from other webpages, be it a WordPress blog or a game score which we want to boast about on Facebook. In all such cases there are three things involved:
A few years back, the user would type his Twitter username and password in the Application, which would then use the credentials of the user to send a tweet. Now, this obviously has flaws like:
To avoid this we need a different mechanism. The user needs to allow the Application to post/tweet on his account – without sharing the username and password to the Application! This is where OAuth comes into the picture. I will briefly talk about it my next post. I guess the entire discussion on how I got my python code to say hello on twitter will consume another three blog posts I guess 🙂
I am trying to write a python code to send out tweets! I will keep updating the status and if it works, the code as well! 🙂
I was going through ashbotandsparki quiz. ( Thanks ahsbotandsparki ! )
I thought I would help out a bit. The updated code can be found in my comment on the above mentioned post. You can also find it here.
What I basically did was:
Some of my friends were recently trying out to create a page where the user can drag and drop pieces of pseudo code and they need to check if his pseudo code is fine. The initial solution used was to check the order in which the lines of the pseudo code were placed. But this soon lead to problems, as we know there is no one unique solution to a problem.