-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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. | 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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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" |