Skip to content

Instantly share code, notes, and snippets.

View kimihito's full-sized avatar
🏠
Working from home

kimihito kimihito

🏠
Working from home
View GitHub Profile
@kimihito
kimihito / geeokigomi.py
Created May 9, 2012 12:54
ギー沖のゴミ捨てお知らせbot
#!/usr/bin/env python
# coding: utf-8
import tweepy
import datetime
consumer_key = "YOUR CONSUMER KEY"
consumer_secret = "YOUR CONSUMER SECRET KEY"
access_token = "YOUR ACCESS TOKEN"
access_secret = "YOUR ACCESS SECRET"
@kimihito
kimihito / cels2fahr.rb
Created June 13, 2012 15:30
たのしいRuby10章
#-*- coding: utf-8 -*-
def cels2fahr(cels)
fahr = cels * 9 / 5 + 32
p fahr
end
cels2fahr(10) #=> 50
cels2fahr(20) #=> 68
@kimihito
kimihito / 11-1.rb
Created June 20, 2012 12:42
たのしいRuby11章
#!/usr/bin/env ruby
#-*- coding: utf-8 -*-
a = Array.new
100.times do |i|
a << i + 1
end
@kimihito
kimihito / ascii.py
Created June 22, 2012 23:43
初めてのPython Ⅲ部
#!/usr/bin/env python
# coding: utf-8
#convert string to ascii code.
S = ["A","B","G"]
for i in S:
print ord(i)
@kimihito
kimihito / pivtweet.py
Created July 9, 2012 17:32
pacceptedstory bot
#!/usr/bin/env python
# coding: utf-8
import pivotal
import tweepy
from bs4 import BeautifulSoup
import datetime as d
from dateutil.parser import parse
import pytz
TOKEN = 'YOUR_TOKEN'
@kimihito
kimihito / twifb.py
Created July 16, 2012 15:16
post hashtags tweet to FB group
#!/usr/bin/env python
# coding: utf-8
import facebook
import tweepy
import urllib
#setting twitter
consumer_key = "YOUR_CONSUMER_KEY"
consumer_secret = "YOUR_SECRET_KEY"
access_token = "YOUR_ACCESS_TOKEN"
access_secret = "YOUR_ACCESS_SECRET"
@kimihito
kimihito / fizzbuzz.py
Created July 18, 2012 12:21
fizzbuzz
for i in range(100):
if i % 15 == 0:
print "FizzBuzz"
elif i % 3 == 0:
print "Fizz"
elif i % 5 == 0:
print "Buzz"
else:
print i
@kimihito
kimihito / mybooklog.py
Created July 28, 2012 14:29
pickup books in mybookself of booklog
#!/usr/bin/env python
# coding: utf-8
import urllib
import json
booklogID = "YOUR_BOOKLOG_ID"
url = 'http://api.booklog.jp/json/%s?category&status=1&category=0&count=1000'% booklogID
f = urllib.urlopen(url)
obj = json.load(f)
books = obj['books']
@kimihito
kimihito / www.py
Created July 30, 2012 13:25
コマンドラインから品詞の後にwwwをつけてつぶやくスクリプト
#!/usr/bin/env python
# coding: utf-8
import sys
import tweepy
from bs4 import BeautifulSoup
import urllib
import urllib2
import random
#YahooAPIのID(各自で取得)
@kimihito
kimihito / twihate.py
Created July 31, 2012 14:57
Twitterで流れてくるはてなブックマークの記事をストックする
#!/usr/bin/env python
# coding: utf-8
import sqlite3
import tweepy
import urllib
import re
import sys
import urllib2
consumer_key = "YOUR_CONSUMER_KEY"