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
/* | |
やりたいこと: | |
いくつかのブログのFeedから、最新の情報を取得し、JSON形式で返したい | |
node -v9.5.0 | |
*/ | |
/*求めている結果 | |
[ | |
[{ |
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
#!/usr/local/bin/python | |
#coding=utf-8 | |
"""post hatena-blog script for CotEditor | |
Post text of the current document on CotEditor to Habeta-blog. | |
This is a CotEditor script. | |
""" | |
__version__ = '1.0.0' | |
__date__ = '2017-08-24' |
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
/* webhook でメッセージを拾う */ | |
function doPost(e) { | |
/* パラメーターを取得し、トークンが不一致なら処理終了 */ | |
var token = e.parameter.token; | |
var properties = PropertiesService.getScriptProperties(); | |
if (token != properties.getProperty('SLACK_REPLY_TOKEN')) { | |
return; | |
} | |
var text = e.parameter.text; |
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
var appId = "Your ID"; | |
var secret = "Your Secret"; | |
function alertAuth() { | |
var service = getService(); | |
var authorizationUrl = service.getAuthorizationUrl(); | |
var template = HtmlService.createTemplate( | |
'<a href="<?= authorizationUrl ?>" target="_blank">認証</a>. ' + | |
'認証が完了したら再度操作を行ってください。'); | |
template.authorizationUrl = authorizationUrl; |
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
function getBoard() { | |
var trelloKey = "XXXXXX";//keyを入力してください | |
var trelloToken = "XXXXXX";//tokenを入力してください | |
var userName = "kaban-chan";//user nameを入力してください | |
var url = 'https://trello.com/1/members/' + userName + '/boards?key=' + trelloKey + '&token=' + trelloToken + '&fields=name'; | |
res = UrlFetchApp.fetch(url, {'method':'get'}); | |
Logger.log(res); | |
} |
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
trello.js | |
function main() { | |
//Trello | |
var key = "trello_key"; | |
var token = "trello_token"; | |
var board = "57b40268d9638e728e6d03e1"; //エディトリアルカレンダー | |
var list = "57b403848c38f7edb2cf8e4f"; //完了済み | |
var cardsUrl = "https://trello.com/1/lists/" + list + "/cards?key=" + key + "&token=" + token; | |
var membersUrl = "https://trello.com/1/boards/" + board + "/members?key=" + key + "&token=" + token; |
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
//mastodonに投稿する | |
function postUpdateToots(message,token,url){ | |
var url = url | |
var options = | |
{ | |
"method" : "post", | |
"payload" : "status=" + message, | |
"headers" : {"Authorization" : "Bearer "+ token} | |
}; |
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
#coding:UTF-8 | |
import requests | |
def main(): | |
url = "https://notify-api.line.me/api/notify" | |
token = #ここにアクセストークンを入力します。 | |
headers = {"Authorization" : "Bearer "+ token} | |
message = 'ここにメッセージを入れます' | |
payload = {"message" : message} |
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
#codeing:UTF-8 | |
import sqlite3 | |
import pandas as pd | |
#ない場合は新たに作成される | |
con = sqlite3.connect('/Users/Desktop/web_data.db') | |
drop_table = "drop table gas_portal_access_log" |
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
#codeing:utf-8 | |
import re | |
from bs4 import BeautifulSoup | |
from urllib.request import urlopen | |
from urllib.parse import unquote | |
url = "https://ja.wikipedia.org/wiki/%E3%83%86%E3%82%A4%E3%83%AB%E3%82%BA_%E3%82%AA%E3%83%96_%E3%82%A4%E3%83%8E%E3%82%BB%E3%83%B3%E3%82%B9" | |
html = urlopen(url) |
NewerOlder