【文章标题】:Show HN: GET Together – A social network where you don’t need POST to Post 【文章标题】:Show HN: GET相聚 —— 一个无需POST请求即可发帖的社交网络
【文章正文】: GET together. /É¡et tÉËɰeðÉ/ verb
-
- To meet and spend time with other human beings.
-
- To write a post using the wrong HTTP method. GET相聚 /É¡et tÉËɰeðÉ/ 动词
-
- 与他人见面共度时光
-
- 用错误的HTTP方法发帖
A social network with no POSTs. Everything you write is a GET request. The posts are public, the newest ones come first, and thatâs about it. 一个没有POST请求的社交网络。你写的所有内容都通过GET请求发送。帖子全部公开,按时间倒序排列,仅此而已。
How to post 发帖指南 GET /post GET /post Change the name and text, then run an example below. A successful request returns the new postâs ID. 修改名称和文本内容后,运行下方示例代码。成功请求将返回新帖子的ID。
curl -G ‘https://gettogether.dev/post’
—data-urlencode ‘name=your_nickname’
—data-urlencode ‘text=hello everyone’
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())
const query = new URLSearchParams({ name: ‘your_nickname’, text: ‘hello everyone’, }); const response = await fetch(‘https://gettogether.dev/post?’ + query); console.log(await response.json());
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) } }
fn main() -> Result<(), Box
{“ok”: true, “id”: “⦔} 200 OK
Names, cookies & other details 名称、Cookie及其他细节 Names. 2â20 letters, numbers, or underscores. Names arenât unique or verified. 名称:2-20个字母、数字或下划线。名称无需唯一且不验证真实性。
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. In cURL, add -b cookies.txt -c cookies.txt to save and reuse it. Keep that file private. Cookie:发帖时Cookie可选。如需删除帖子,请保留服务器返回的gt_session cookie并在下次请求时发送。使用cURL时添加-b cookies.txt -c cookies.txt参数可保存复用,请妥善保管该文件。
Retries. The server creates an ID if you leave it out. For safe retries, send your own id UUID and reuse it with the same cookie. Requests without an ID create a new post each time. 重试:未提供ID时服务器会自动生成。安全的重试方式是发送自定义的id UUID并配合相同cookie使用。不带ID的请求每次都会创建新帖子。
Endpoints. /post?name=alice&text=hello writes a post. /feed returns posts as JSON. /heart?id=â¦&on=1 adds a heart; use on=0 to remove it. /delete?id=⦠deletes your own post. All use GET. 端点:/post?name=alice&text=hello 用于发帖。/feed 返回JSON格式的帖子列表。/heart?id=â¦&on=1 点赞,on=0取消点赞。/delete?id=⦠删除自己的帖子。全部使用GET方法。
Replies. Add parent=POST_ID to /post to reply to a post. Open its replies to copy an example. /feed?parent=POST_ID returns its replies and the original post. Replies can have replies, and use the same limits and moderation checks. Deleting a post preserves other usersâ replies. 回复:在/post添加parent=POST_ID参数即可回复帖子。打开回复列表可复制示例。/feed?parent=POST_ID 返回该帖的回复及原帖。回复可嵌套,并受相同限制和审核规则约束。删除帖子不会影响其他用户的回复。
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. Donât include private information. 隐私:帖子内容公开且会显示在URL中,请勿包含私人信息。
-
400
-
Check the name, text and UUID.
-
400
-
检查名称、文本和UUID
-
403
-
Check the owner cookie or request origin.
-
403
-
检查所有者cookie或请求来源
-
429
-
Wait ten seconds and retry.
-
429
-
等待十秒后重试