全部PHPで書いているので他の言語を使うときは読み替えて下さい。Twitter APIのライブラリはTwistOAuthを使っています。
ここで説明するのは公式のAPIからの取得のみです。作成はここからでは出来ません。出来るのは取得のみです。
公式のキーでログインする必要があります。サードパーティではアンケートの情報が一切入らないためです。
// Twitter for Macのキーでログイン
{ | |
"extends": "standard", | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"sourceType": "module", | |
"allowImportExportEverywhere": false | |
}, | |
"env": { | |
"browser": true, | |
"node": true, |
#!/bin/bash | |
for group in $(aws logs describe-log-groups | jq -r '.logGroups[].logGroupName'); do | |
echo "Fetching: $group" | |
for stream in $(aws logs describe-log-streams --log-group-name "$group" | jq -r ' | |
.logStreams[] | |
| select(.storedBytes == 0 and ($now|tonumber) - .creationTime / 1000 > 86400) | |
| .logStreamName | |
' --arg now $(date +%s)); do | |
echo "Deleting: $group $stream" |
// ==UserScript== | |
// @name Qiita Trend Eliminator | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description https://qiita.com/ を https://qiita.com/tag-feed にいい感じに置き換える | |
// @author mpyw | |
// @match https://qiita.com/* | |
// @grant none | |
// ==/UserScript== |
#!/bin/bash | |
# ----------------------------------------------------------------------- | |
# Copyright (C) 2013 Matthias Sohn <matthias.sohn@sap.com> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
ぬあのようにあのようにア紫やおおお | |
chi枯れしぼむ・.・(小さな声) | |
MUR大変だった向こう脛ーこんにちは | |
重い。... これ ... ああ、とてもすでに今日、 | |
それがそのようなキツいんすでも、私は好きでしょう、そして辞職するために既に来るために、なんで。何かがぶっとぅです。- | |
どのようにする起こるか〜ナ・トグや〜 | |
彼は移動します -- それは迅速です... | |
ワイシャツすでに…ずぶぬれになります | |
洗面所のケースは、元気を回復します | |
2つのケース |
// ==UserScript== | |
// @name 新 Twitter で「最新のツイート」に強制的に切り替えるやつ | |
// @namespace https://twitter.com/mpyw | |
// @version 0.1 | |
// @description お節介機能を殺す | |
// @author mpyw | |
// @match https://twitter.com/home | |
// @grant none | |
// ==/UserScript== |
<?php | |
// https://stackoverflow.com/questions/16585502/array-splice-preserving-keys/70576992#70576992 | |
function array_splice_assoc(array &$input, int|string $offset, ?int $length = null, $replacement = []): array | |
{ | |
// Normalize offset | |
$offset = match (true) { | |
is_string($offset) => array_flip(array_keys($input))[$offset] ?? throw new OutOfBoundsException(), | |
$offset < 0 => count($input) + $offset, |