HN 日本語サマリー

← 一覧へ戻る
Web開発

Show HN: GET Together – POSTせずに投稿できるソーシャルネットワーク

Show HN: GET Together – A social network where you don't need POST to Post (gettogether.dev)

16 pointsby nchudleigh7 コメント

要約

GET Togetherは、HTTPのPOSTメソッドを使わずにGETリクエストだけで投稿できる新しいソーシャルネットワークです。投稿は公開され、最新のものが最初に表示されます。cURL、Python、JavaScript、Go、Rustなどの様々な言語で投稿する方法がコード例と共に紹介されており、投稿の制限やプライバシーに関する情報も提供されています。

全文翻訳

GET together./ɡet təˈɡeðə/ verb1. To meet and spend time with other human beings. (他の人間と会って時間を過ごすこと)2. To write a post using the wrong HTTP method. (間違ったHTTPメソッドで投稿を書くこと)POSTのないソーシャルネットワーク。あなたが書くすべてはGETリクエストです。投稿は公開され、最も新しいものが最初に表示されます。それだけです。 0 posts so far. (これまでの投稿数: 0) Add yours ↗ (あなたの投稿を追加 ↗) How to post (投稿方法) GET /post Change the name and text, then run an example below. A successful request returns the new post’s ID. (名前とテキストを変更し、以下の例を実行してください。成功したリクエストは新しい投稿のIDを返します。) cURL Python JavaScript Go Rust Copy (コピー) No headers, keys or IDs needed. (ヘッダー、キー、IDは不要です。) curl -G 'https://gettogether.dev/post' \ --data-urlencode 'name=your_nickname' \ --data-urlencode 'text=hello everyone' Python 3 · standard library from urllib.request import urlopen from urllib.parse import urlencode query = urlencode({"name": "your_nickname", "text": "hello everyone"}) with urlopen("https://gettogether.dev/post?" + query) as response: print(response.read().decode()) Node.js 20+ · save as post.mjs const query = new URLSearchParams({ name: 'your_nickname', text: 'hello everyone', }); const response = await fetch('https://gettogether.dev/post?' + query); console.log(await response.json()); Go · go run post.go package main import ( "io" "net/http" "net/url" "os" ) func main() { query := url.Values{ "name": {"your_nickname"}, "text": {"hello everyone"}, } res, err := http.Get("https://gettogether.dev/post?" + query.Encode()) if err != nil { panic(err) } defer res.Body.Close() if _, err := io.Copy(os.Stdout, res.Body); err != nil { panic(err) } } Rust · cargo add reqwest --features blocking fn main() -> Result<(), Box<dyn std::error::Error>> { let response = reqwest::blocking::Client::new() .get("https://gettogether.dev/post") .query(&[("name", "your_nickname"), ("text", "hello everyone")]) .send()?; println!("{}", response.text()?); Ok(()) } Response (レスポンス) {"ok": true, "id": "…"} 200 OK 280 characters max. (最大280文字) One post per 10 seconds. (10秒あたり1投稿) Names, cookies & other details (名前、クッキー、その他の詳細) Names (名前): 2–20 letters, numbers, or underscores. (2〜20文字、数字、またはアンダースコア)。Names aren’t unique or verified. (名前はユニークではなく、検証されません。) Cookies (クッキー): Cookies are optional for posting. (投稿にクッキーは必須ではありません。) To delete a post later, keep the gt_session cookie returned by the server and send it with your next request. (後で投稿を削除するには、サーバーから返されたgt_sessionクッキーを保持し、次のリクエストで送信してください。) In cURL, add -b cookies.txt -c cookies.txt to save and reuse it. (cURLでは、保存して再利用するために-b cookies.txt -c cookies.txtを追加してください。) Keep that file private. (そのファイルをプライベートに保ってください。) Retries (リトライ): The server creates an ID if you leave it out. (IDを省略した場合、サーバーがIDを作成します。) For safe retries, send your own id UUID and reuse it with the same cookie. (安全なリトライのために、独自のID UUIDを送信し、同じクッキーで再利用してください。) Requests without an ID create a new post each time. (IDのないリクエストは、毎回新しい投稿を作成します。) Endpoints (エンドポイント): /post?name=alice&text=hello writes a post. (/post?name=alice&text=hello は投稿を作成します。) /feed returns posts as JSON. (/feed は投稿をJSONで返します。) /heart?id=…&on=1 adds a heart; use on=0 to remove it. (/heart?id=…&on=1 はハートを追加します。削除するにはon=0を使用してください。) /delete?id=… deletes your own post. (/delete?id=… は自分の投稿を削除します。) All use GET. (すべてGETを使用します。) Replies (返信): Add parent=POST_ID to /post to reply to a post. (投稿に返信するには、/post にparent=POST_IDを追加してください。) Open its replies to copy an example. (例をコピーするには、その返信を開いてください。) /feed?parent=POST_ID returns its replies and the original post. (/feed?parent=POST_ID はその返信と元の投稿を返します。) Replies can have replies, and use the same limits and moderation checks. (返信は返信を持つことができ、同じ制限とモデレーションチェックを使用します。) Deleting a post preserves other users’ replies. (投稿を削除しても、他のユーザーの返信は保持されます。) Moderation (モデレーション): New posts and names are checked for English profanity and crypto content. (新しい投稿と名前は、英語の冒涜的な言葉やクリプトコンテンツについてチェックされます。) Crypto, Bitcoin, memecoins and token promotion are not allowed. (クリプト、ビットコイン、ミームコイン、トークンのプロモーションは許可されていません。) Reports trigger an automated abuse review. (報告は自動的な不正使用レビューをトリガーします。) Clear violations are hidden; reporting alone does not remove a post. (明白な違反は非表示にされます。報告だけでは投稿は削除されません。) Read the rules. (ルールを読む) Privacy (プライバシー): The post is public, and its text is part of the URL. (投稿は公開されており、そのテキストはURLの一部です。) Don’t include private information. (個人情報を含めないでください。) 400 Check the name, text and UUID. (名前、テキスト、UUIDを確認してください。) 403 Check the owner cookie or request origin. (オーナーのクッキーまたはリクエストのオリジンを確認してください。) 429 Wait ten seconds and retry. (10秒待ってから再試行してください。)