Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

commit

  • Loading branch information...
commit 181252ff69198c3da4d24f0b8e6d72eb5f3c63fe 1 parent 9861805
Cedric Sam cedricsam authored
Showing with 19 additions and 3 deletions.
  1. +3 −3 README
  2. +16 −0 mypass.py
6 README
View
@@ -1,7 +1,7 @@
-twitter.oauth.py and facebook.oauth.py perform various pull operations from Twitter and Facebook. Must replace hardcoded values of token and secret keys with your own. Usage information is generally available when running the script.
+twitter.oauth.py and facebook.oauth.py perform various pull operations from Twitter and Facebook. The OAuth token and secret, Facebook ID, should be in your version of mypass.py. Usage information is generally available when running the script. facebook.search.py is used for searching (a way of discovering new contents by keyword search).
twitter_pull.sql and facebook_pull.sql should create the postgresql databases needed to store the data of these aforementioned scripts.
-I made tools for Sina Weibo as well.
+We also have tools for Sina Weibo, the most popular Chinese microblogging system. The API is more easily accessible with cURL, so I wrote a wrapper script for cURL in BASH shell (sinagetter.sh), and a Python script that interfaces with the database (sinastorage.py).
-These scripts are developed under Linux (Ubuntu 10.04). I used Python 2.6.5 and my Postgresql is 8.3.
+These scripts are developed under Linux (Ubuntu Lucid 10.04). I used Python 2.6.5 and my version of Postgresql is 8.3 (with Postgis 1.5).
16 mypass.py
View
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+
+import pg
+
+def getConn():
+ return pg.DB('DB_NAME', '127.0.0.1', 5432, None, None, 'DB_USER', 'DB_PASS')
+
+def getTwitterOauth():
+ return { "consumer_key": "YOUR_CONSUMER_KEY", "consumer_secret": "YOUR_CONSUMER_SECRET",\
+ "oauth_token": "YOUR_OAUTH_TOKEN", "oauth_token_secret": "YOUR_OAUTH_SECRET" }
+
+def getFacebookOauth():
+ return { "app_id": "YOUR_APPID", "access_token": "YOUR_TOKEN" }
+
+def getFacebookUserId():
+ return "YOUR_FBID"
Please sign in to comment.
Something went wrong with that request. Please try again.