TweetPic allows you to capture and serve images of a tweet.
- visit Tweetpic (Tunneled Website)
- Notion Tweetpic
Notes
- this was run in Linux/Debian 12-64
- filled .env
- with https
Require
- go 1.19++
- chrome
- run manually chrome/ium headless devtools debugging remote with
- "chromium --headless=old --disable-gpu --remote-debugging-port=9222"
- bash build_run.sh (?sudo)
Retrieves a picture of a specified tweet.
- URL:
/tweetpic
- Method: GET
- Query Parameters:
id
(required): The ID of the tweet to capture
-
200 OK
- Content-Type: application/json
- Schema:
{ "TweetPicUrl": "/image?name=123e4567-e89b-12d3-a456-426614174000.jpeg" }
-
400 Bad Request
- Content-Type: application/json
- Schema:
{ "Error": "Tweet Doesnt Exist" }
-
429 Too Many Requests
- Content-Type: application/json
- Schema:
{ "Error": "Too many requests, slow down!" }
Serves the generated tweet image.
- URL:
/image
- Method: GET
- Query Parameters:
name
(required): The name of the image file to serve
-
200 OK
- Content-Type: image/jpeg, image/png, or image/gif
- Content: Binary image data
-
400 Bad Request
- Content-Type: text/plain
- Content: Error message
-
404 Not Found
- Content-Type: text/plain
- Content: Error message
Checks the health status of the API.
- URL:
/health-check
- Method: GET
- 200 OK
- Content-Type: application/json
- Schema:
{ "Status": 200 }
- The API serves static files from the root directory.
- Tweet screenshot image files are stored in the
./images/
directory. - The server listens on port 443 for HTTPS connections.