I am working on an app that basically shows content from a website, in a native app. To do this, I wrote a python script that scrapes the page for content, and then inserts records into the database. I didn't want to mess with a sms gateway or email server to notify me when it's found changes in the original page, so I decided to make the script post to twitter when it updates.
Following this page with few modifications, I was able to get this working with Python 3 and tweepy1.4.
This is what the code to get the pin looks like, two things that changed in python from 2 to 3 is 'raw_input' becomes 'input' and print behaves like a regular function requiring parentheses.
# python code
import tweepy
CONSUMER_KEY = 'key here'
CONSUMER_SECRET = 'secret here'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth_url = auth.get_authorization_url()
print('Please authorize: ' + auth_url)
verifier = input('PIN: ').strip()
auth.get_access_token(verifier)
print("ACCESS_KEY = '%s'" % auth.access_token.key)
print("ACCESS_SECRET = '%s'" % auth.access_token.secret)
From here you should have no problem following Jeff Millers blog post.
@kpfsoftware is where the bot posts, hopefully i'll have the app in the market in the next few days.
And there you have it, a twitter bot using Python 3.
Thursday, January 27, 2011
Saturday, January 8, 2011
RedTag Discount Calculator
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyNFKeBSS7D1MiSbiQConrKN1J1InJIUXZz_Z-iFDTq7l9PsI3YnKDFQVpcNW_Bcik81FmLtAcx48NYh8crd3Rv40LlOg9WsxEAWs0oLv7J5nbntbxX8M9yoMerOEVmVSz7dFCBor0nU57/s320/snap20110108_095248.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSAg3TFBUq4bbTD9X4nNqETIyD3RcIWVs8qhb6KP8feUWI1JQXXG-kzYRd9YxiHBQVW7FxJgpf2-DV7nghTDCwEatjHYtLCHBtnX3C_PKKUbMK5_0LXt1A_RsyouB9GidV6lenIcS8yknz/s320/snap20110107_212247.png)
Created a super simple discount calculator, first app with AdMob ads.
- Extra large text
- Numeric input (uses your keyboard)
- Keyboard hides when clicking 'find price'
Get it from the market, visit here on your Android browser or use the barcode below.
Sunday, January 2, 2011
Archery Tool Updated - 0.3.7
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ9EsaE99RMmmx6D5eyY_KAPynNGOJuUfmhRnqlIAePXzmyozHKj9ZRktqpEkWFFf0D4WkwAxSxCJHI8gOhxNKvadh6qL1WlswkqbDcFSXZquJLhrKbXouR8BGMa7P_xbs0MVi8pQFpQ56/s320/snap20110102_215725.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMstOPohUNUnExrVi2BxO5f6fdLlCKujCtjTVv77uq3a3E9latHCJCp4aJDmbFkYuPjwkTs6Wto8zYNTIyE9UfosXEDnawumk7fDY6XhOFsd1d4PisEOX-tYPU01BydFoQQQepcYbTCTSX/s320/snap20110102_215816.png)
Subscribe to:
Posts (Atom)