Skip to content

Instantly share code, notes, and snippets.

@vim13
Last active December 12, 2015 04:59
Show Gist options
  • Save vim13/4718788 to your computer and use it in GitHub Desktop.
Save vim13/4718788 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/python
#vim:fileencoding=utf-8
import cgi
import sys
sys.path.append('/home/hoge/lib/python')
import tweepy
consumer_key = 'hoge'
consumer_secret = 'hoge'
access_token = 'hoge'
access_token_secret = 'hoge'
auth = tweepy.OAuthHandler(consumer_key,consumer_secret)
auth.set_access_token(access_token,access_token_secret)
api = tweepy.API(auth)
print 'Content-type: text/html; charset=UTF-8'
print "\r\n\r\n"
print "<html><body>"
form = cgi.FieldStorage()
form_filled = 0
if form.has_key("status_id"):
form_filled = 1
if form_filled == 0:
print "error"
else:
api.create_favorite(form["status_id"].value)
print "sszkは " + form["status_id"].value + " をふぁぼりました"
print "</body></html>"
#!/usr/local/bin/python
#vim:fileencoding=utf-8
import cgi
import sys
sys.path.append('/home/hoge/lib/python')
import tweepy
consumer_key = 'hoge'
consumer_secret = 'hoge'
access_token = 'hoge'
access_token_secret = 'hoge'
auth = tweepy.OAuthHandler(consumer_key,consumer_secret)
auth.set_access_token(access_token,access_token_secret)
api = tweepy.API(auth)
print 'Content-type: text/html; charset=UTF-8'
print "\r\n\r\n"
print "<html><body>"
form = cgi.FieldStorage()
form_filled = 0
if form.has_key("user"):
form_filled = 1
if form_filled == 0:
print "error"
else:
api.create_friendship(form["user"].value)
print "sszkは @" + form["user"].value + " をフォローし始めました"
print "</body></html>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment