我希望能够从命令行粘贴到 pastebin(或类似程序),但似乎pastebinit
不再起作用了:
THIS API HAS BEEN DISABLED. Please use Pastebin's new API. http://pastebin.com/api
答案1
你可以。使用 GitHub gist。
curl -X POST \--data-binary '{"files": {"file1.txt": {"content": "Hello, SO"}}}' \https://api.github.com/gists
答案2
使用此脚本:
#!/bin/bash
api_key=xxxxxxx-my-dev-API-key-xxxxxxx
curl -d "api_paste_code=$(jq -sRr @uri)" \
-d "api_dev_key=$api_key" \
-d 'api_option=paste' 'https://pastebin.com/api/api_post.php'
echo # By default, there's no newline printed by curl