Skip to content

Instantly share code, notes, and snippets.

View miya's full-sized avatar
🧖‍♂️

Shun Miyazawa miya

🧖‍♂️
View GitHub Profile
@miya
miya / BestPrice.py
Created January 8, 2018 14:44
ビットコインの最適価格を出すやつ(アビトラ用)
import requests
def bitflyer():
URL = 'https://lightning.bitflyer.jp/v1/getticker'
ticker = requests.get(URL).json()
price = int(ticker['best_ask']),int(ticker['best_bid'])
return price
def coincheck():
URL = 'https://coincheck.com/api/ticker'
@miya
miya / extra.css
Last active January 5, 2018 14:57
Calibre用スタイリングするやつ
 * {
line-height: 150%;
}
@font-face {
font-family: "ヒラギノ角ゴ ProN W3", "Hiragino Kaku Gothic ProN", "メイリオ", Meiryo, sans-serif;
}
body{
font-family:"MS P明朝", "MS PMincho", "ヒラギノ明朝 Pro W3", "Hiragino Mincho Pro", serif;
@miya
miya / TooT.py
Last active August 10, 2018 14:50
つーとするやつ
from mastodon import Mastodon
while True:
toot = input('> ',)
mastodon = Mastodon(
client_id="app_key.txt",
access_token="user_key.txt",
url = "https://mstdn.jp")
@miya
miya / CreateKeys.py
Last active April 7, 2018 19:19
MastodonのSetupするやつ
from mastodon import Mastodon
url = "https://mstdn.jp" #URLの部分はインスタンスURLです。今回はmstdn.jpになっていますが、任意で変更して下さい。
name = input('クライアント名\n> ') #クライアント名を入力して下さい。(自由記述)
#Mastodonのアプリ登録を行ないます。
Mastodon.create_app(name,
api_base_url = url,
to_file = "app_key.txt"
)
@miya
miya / AoutRT.py
Created January 4, 2018 11:58
特定の文字列を含むツイートをリツイートするやつ
import tweepy
def api(): #関数apiを生成します。https://apps.twitter.com にて consumerkey等を取得して各自で代入して下さい
consumer_key = 'consumer_key'
consumer_secret = 'consumer_secret'
access_key = 'access_key'
access_secret = 'access_secret'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
api = tweepy.API(auth)
@miya
miya / bitTweet.py
Last active January 7, 2018 11:25
bitFlyerのAPIを使って定期的に価格をツイートするやつ
import re
import tweepy
import datetime
import pybitflyer
todaydetail = datetime.datetime.today() #ツイート内に置く時計を定義しておきます。
today = todaydetail.strftime("%m/%d %H:%M")
def Tweet(text): #https://apps.twitter.com にて consumerkey等を取得して各自で代入して下さい
consumer_key = 'consumer_key'
@miya
miya / AoutFav.py
Last active January 5, 2018 09:02
自動ふぁぼのふぁぼ対象をリプライを除くツイートにしてみたやつ
import tweepy
def api():
consumer_key = 'consumer_key'
consumer_secret = 'consumer_secret'
access_key = 'access_key'
access_secret = 'access_secret'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
api = tweepy.API(auth)
@miya
miya / AoutFav.py
Last active January 5, 2018 09:03
特定の文字列を含むツイートを自動でふぁぼるやつ
import tweepy
def api():
consumer_key = 'consumer_key'
consumer_secret = 'consumer_secret'
access_key = 'access_key'
access_secret = 'access_secret'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
api = tweepy.API(auth)
@miya
miya / bitTweet.py
Last active January 7, 2018 11:26
bitFlyerをスクレイピングしてビットコインの価格をツイートするやつ
import re
import urllib
import tweepy
import datetime
from bs4 import BeautifulSoup as b4
todaydetail = datetime.datetime.today()
today = todaydetail.strftime("%m/%d %H:%M")
#https://apps.twitter.com にて consumerkey等を取得して各自で代入して下さい