Skip to content

Instantly share code, notes, and snippets.

// Rewrote "create_tweet.js" using axios, instead of got.
// https://github.com/twitterdev/Twitter-API-v2-sample-code/blob/main/Manage-Tweets/create_tweet.js
// License: Apache 2.0
// Worked under the below environment
// node v16.4.0
// "axios": "^0.26.0",
// "crypto": "^1.0.1",
// "oauth-1.0a": "^2.2.6",
// "querystring": "^0.2.1",
// "readline": "^1.3.0"
@Nick-smallworld
Nick-smallworld / create_tweet.mjs
Last active February 27, 2022 04:42
Rewrite sample code "create_tweet.js" available at "twitterdev"
// Rewrote "create_tweet.js" using ESModule.
// https://github.com/twitterdev/Twitter-API-v2-sample-code/blob/main/Manage-Tweets/create_tweet.js
// License: Apache 2.0
import got from 'got';
import crypto from 'crypto';
import OAuth from 'oauth-1.0a';
import qs from 'querystring';
import readline from 'node:readline';
@Nick-smallworld
Nick-smallworld / gist:3334765b0597a8451af294ab1d17f4b1
Created April 4, 2018 08:41
MT7 コンテンツタイプ サンプル用CSS(レシピ)
@charset "UTF-8";
html {
background:#fff;
color:#000;
font-family:sans-serif;
-ms-text-size-adjust:100%;
-webkit-text-size-adjust:100%
}
@Nick-smallworld
Nick-smallworld / gist:c1671b0ce7251175f9805a56a943d4b7
Created April 19, 2017 09:20
fetchをつかってMTからJSONをGETしたあとconsole.logで表示する
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script>
fetch('http://your-mt/mt-data-api.cgi/v3/sites/blog_id/entries')
.then((response) => response.json())
.then((json) => console.log(json));
@Nick-smallworld
Nick-smallworld / movetest.html
Created February 14, 2017 05:58
テストサーバー確認用ファイル
test file
@Nick-smallworld
Nick-smallworld / gist:8dc77268fd6049333bae99147132b557
Created December 18, 2016 05:48
AWSハンズオン用のアクセスポリシー
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::handson-sample/*"
}