Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

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

mpyw mpyw

🏠
Working from home
View GitHub Profile
@mpyw
mpyw / gist:3871869
Created October 11, 2012 11:58
Twitter Developers/Changing application's settings (PHP)
<?php
// PHP 移植バージョン。こっちはもっとデバッグしてないバージョンです。
// @re4k 2012/10/11
class TwitterDevelopers
{
private $cookie;
private $boundary = "re4kboundary";
private $user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/18.0 Firefox/18.0 FirePHP/0.7.1";
private function request($uri, $type = "GET", $data)
{"metadata":{"cursor":"TWEET-297200423289372672-299836180898402304"},"modules":[{"user_gallery":{"metadata":{"result_type":"normal"},"data":[{"metadata":{"result_type":"top"},"data":{"id":306691799,"id_str":"306691799","name":"\u6253\u3061\u6b62\u3081","screen_name":"LO_misaka","location":"\u3042\u306e\u4eba\u306e\u305d\u3070","description":"\u30df\u30b5\u30ab\u306f\u300c\u3068\u3042\u308b\u9b54\u8853\u306e\u7981\u66f8\u76ee\u9332\u300d\u306e\u4e00\u65b9\u901a\u884c\u5927\u597d\u304d\u306a\u6253\u3061\u6b62\u3081\u3060\u3088\u3001\u3063\u3066\u30df\u30b5\u30ab\u306f\u30df\u30b5\u30ab\u306f\u8aac\u660e\u3057\u3066\u307f\u305f\u308a\u3002\u975e\u516c\u5f0f\u306e\u5168\u624b\u52d5\u306a\u306e\u3067\u3001\u305d\u3053\u306e\u3068\u3053\u308d\u306f\u3088\u308d\u3057\u304f\u306d\u3063\u3066\u30df\u30b5\u30ab\u306f\u30df\u30b5\u30ab\u306f\u304a\u9858\u3044\u3057\u3066\u307f\u308b\uff01","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":1701,"friends_count":1537,"listed_count":83,"c
@mpyw
mpyw / twcount.php
Last active October 21, 2016 10:58
最近のついったーはいじんどをしらべるよ
<?php
function prompt($msg, $hidden = false) {
echo $msg;
if ($hidden) {
`stty -echo`;
}
$r = trim(fgets(STDIN));
if ($hidden) {
`stty echo`;
Plugin.create(:inmuapi) do
[(1..4).to_a, "一二三四".chars].transpose.each do |num, knum|
command(:"inmuapi_#{num}", name: "真夏の夜の淫夢 #{knum}章", condition: -> _ { true }, visible: true, role: :postbox) do |opt|
res = Net::HTTP.get_response(URI.parse("http://api.yukkurisinai.net/inmu/story/#{num}"))
text = JSON.parse(res.body)["Plot"]
Plugin.create(:gtk).widgetof(opt.widget).widget_post.buffer.text = text
end
end
end
@mpyw
mpyw / otinpo.rb
Created March 20, 2017 06:48 — forked from rhenium/otinpo.rb
ウーン…もっと短くできると思うんだけど
r,s="おちんぽ","";s<<r[rand 4]until s.match r;puts s,"\nおぉぉお゙お゙~っ!!イグゥウ!!イッグゥウウ!!\n\n#{s.size}回目で果てました…"
// https://api.twitter.com/1.1/search/universal.json?q=tweenq
{
"metadata": {
"cursor": "TWEET-170606166982930432-299822566774808577"
},
"modules": [
{
"status": {
"data": {
"contributors": null,
@mpyw
mpyw / gist:c0d8061c502b3eb9c52a8cc1e62e7764
Created March 20, 2017 06:49
サードのコンシューマキーでは使えないようです。Twitter for Android のキーを使用しました。 GET https://api.twitter.com/1.1/statuses/media_timeline.json
[{
"created_at": "Fri Feb 08 09:36:04 +0000 2013",
"id": 299813838403010560,
"id_str": "299813838403010560",
"text": "\u753b\u50cfpost\u3066\u3059\u3061 http:\/\/t.co\/49XVeerc",
"source": "\u003ca href=\"http:\/\/ksoft.dip.jp\/\" rel=\"nofollow\"\u003ere4k\u003c\/a\u003e",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
@mpyw
mpyw / square_twitter.user.js
Last active June 15, 2017 18:14
Twitterは四角っぽいほうが好き
// ==UserScript==
// @name we_love_square_twitter
// @namespace https://gist.github.com/mpyw/199917673d4eef200e0532af2aadda85
// @version 0.0.3
// @description ● → ■
// @author foooomio (より優れているので拝借させていただきました: http://qiita.com/foooomio/items/a8307820aabab37e02f2 )
// @match https://twitter.com/*
// @grant none
// ==/UserScript==
@mpyw
mpyw / run.php
Last active January 31, 2018 13:19
ツイート数を常に1000件に保つやつ(デバッグしてない)
<?php
require __DIR__ . '/vendor/autoload.php';
use mpyw\Co\Co;
use mpyw\Cowitter\Client;
const CONSUMER_KEY = '...';
const CONSUMER_SECRET = '...';
const ACESS_TOKEN = '...';
{
"extends": "standard",
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module",
"allowImportExportEverywhere": false
},
"env": {
"browser": true,
"node": true,