this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #20 from websages/apidocspage

feat: Add API docs at /api_docs

authored by

Michael Stahnke and committed by
GitHub
9de5cd14 8c02eb92

+199
+31
htdocs/api_docs/index.html
··· 1 + <!DOCTYPE html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="utf-8" /> 5 + <meta name="viewport" content="width=device-width, initial-scale=1" /> 6 + <meta 7 + name="description" 8 + content="SwaggerUI" 9 + /> 10 + <title>Tumble API Docs</title> 11 + <link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui.css" /> 12 + </head> 13 + <body> 14 + <div id="swagger-ui"></div> 15 + <script src="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui-bundle.js" crossorigin></script> 16 + <script src="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui-standalone-preset.js" crossorigin></script> 17 + <script> 18 + window.onload = () => { 19 + window.ui = SwaggerUIBundle({ 20 + url: 'openapi.yaml', 21 + dom_id: '#swagger-ui', 22 + presets: [ 23 + SwaggerUIBundle.presets.apis, 24 + SwaggerUIStandalonePreset 25 + ], 26 + layout: "StandaloneLayout", 27 + }); 28 + }; 29 + </script> 30 + </body> 31 + </html>
+168
htdocs/api_docs/openapi.yaml
··· 1 + openapi: 3.0.0 2 + info: 3 + title: Tumble API 4 + description: API documentation for the Tumble application. 5 + version: 1.0.0 6 + servers: 7 + - url: / 8 + paths: 9 + /index.cgi: 10 + get: 11 + summary: Get Tumble Feed 12 + description: Retrieves the main content feed (Tumblelog). 13 + parameters: 14 + - name: i 15 + in: query 16 + description: Pagination offset. (i * 6 days ago) 17 + schema: 18 + type: integer 19 + - name: dtype 20 + in: query 21 + description: Output format. 22 + schema: 23 + type: string 24 + enum: [html, rss, xml] 25 + default: html 26 + responses: 27 + '200': 28 + description: Successful response 29 + content: 30 + text/html: 31 + schema: 32 + type: string 33 + application/rss+xml: 34 + schema: 35 + type: string 36 + text/xml: 37 + schema: 38 + type: string 39 + 40 + /search.cgi: 41 + get: 42 + summary: Search Tumble Content 43 + description: Search for content within the Tumblelog. 44 + parameters: 45 + - name: search 46 + in: query 47 + description: Search term (must be at least 4 characters). 48 + required: true 49 + schema: 50 + type: string 51 + - name: dtype 52 + in: query 53 + description: Output format (sets Content-Type but may still return HTML structure). 54 + schema: 55 + type: string 56 + enum: [html, rss, xml] 57 + responses: 58 + '200': 59 + description: Search results 60 + content: 61 + text/html: 62 + schema: 63 + type: string 64 + 65 + /ogpreview.cgi: 66 + get: 67 + summary: Open Graph Preview 68 + description: Fetches a URL and extracts Open Graph and Twitter Card metadata. 69 + parameters: 70 + - name: url 71 + in: query 72 + description: The URL to inspect. 73 + required: true 74 + schema: 75 + type: string 76 + responses: 77 + '200': 78 + description: JSON object containing extracted metadata. 79 + content: 80 + application/json: 81 + schema: 82 + type: object 83 + additionalProperties: 84 + type: string 85 + '500': 86 + description: Error fetching or parsing URL. 87 + content: 88 + application/json: 89 + schema: 90 + type: object 91 + 92 + /irclink/index.cgi: 93 + get: 94 + summary: Redirect to Link 95 + description: Increments click count and redirects to the target URL. 96 + parameters: 97 + - name: id 98 + in: query 99 + description: The ircLinkID to redirect to (passed as query string without key, e.g. ?123). 100 + schema: 101 + type: integer 102 + responses: 103 + '302': 104 + description: Redirect to target URL. 105 + 106 + post: 107 + summary: Submit Link 108 + description: Submits a new link to the Tumblelog. 109 + requestBody: 110 + content: 111 + application/x-www-form-urlencoded: 112 + schema: 113 + type: object 114 + required: 115 + - user 116 + - url 117 + properties: 118 + user: 119 + type: string 120 + description: Username of the submitter. 121 + url: 122 + type: string 123 + description: The URL to submit. 124 + source: 125 + type: string 126 + enum: [irc] 127 + description: If set to 'irc', returns raw ID instead of HTML redirect page. 128 + responses: 129 + '200': 130 + description: Success 131 + content: 132 + text/plain: 133 + schema: 134 + type: string 135 + description: ID of created link (if source=irc) or '0' on failure. 136 + text/html: 137 + schema: 138 + type: string 139 + description: HTML confirmation page (default). 140 + 141 + /quote/index.cgi: 142 + post: 143 + summary: Submit Quote 144 + description: Submits a new quote to the Tumblelog. 145 + requestBody: 146 + content: 147 + application/x-www-form-urlencoded: 148 + schema: 149 + type: object 150 + required: 151 + - quote 152 + - author 153 + properties: 154 + quote: 155 + type: string 156 + description: The quote content (URI encoded). 157 + author: 158 + type: string 159 + description: The author of the quote (URI encoded). 160 + responses: 161 + '200': 162 + description: Success 163 + content: 164 + text/plain: 165 + schema: 166 + type: string 167 + example: "1" 168 +