Open seabird-bot opened 7 years ago
Multiple design options for this that I can think of:
!archive
to archive the last link in the channel. Allow users to type !archive <link>
to archive a specific link.Archive.fo has a POST endpoint at https://archive.fo/submit/
This takes the two following parameters of Content-Type application/x-www-form-urlencoded
:
submitid
: CSRF token at CSS Selector #submiturl > input:nth-child(1)
at URL https://archive.fo/
url
:The URL to archivePossible response codes: 200
, 307
We should send the archive URL to IRC in the query/channel it was requested from. The archive links look like shortened URLs, for ex: https://archive.fo/3AKV6
Cache-Control: private, no-cache, no-store, must-revalidate, maxage=0
Content-Encoding: gzip
Content-Length: 243
Content-Type: text/html;charset=utf-8
Date: Sat, 18 Feb 2017 09:51:10 GMT
Expires: Sat, 01 Jan 2000 00:00:00 GMT
Pragma: no-cache
Server: cloudflare-nginx
X-Firefox-Spdy: h2
refresh: 0;url=https://archive.fo/FuBOT
Contains a JS window location redirect to the page in the refresh
header in the response. No specific example will be given here, as the required data to implement this is in the headers.
Cache-Control: private, no-cache, no-store, must-revalidate, maxage=0
Content-Length: 0
Date: Sat, 18 Feb 2017 10:07:28 GMT
Expires: Sat, 01 Jan 2000 00:00:00 GMT
Location: https://archive.fo/3AKV6
Pragma: no-cache
Server: cloudflare-nginx
X-Firefox-Spdy: h2
Filed by djt in #main