### Usage
Same as `proxy`.
+
+## unroll
+
+Redirects a tweet thread to the corresponding Threadreader thread.
+
+### Usage
+
+Same as `proxy`, but only works on tweet URLs.
"qr",
"ip",
"uuid",
- "style"
+ "style",
+ "unroll"
]
}
--- /dev/null
+async function handleRequest(request) {
+ const url = new URL(request.url);
+ const queryString = decodeURIComponent(url.search.substring(1));
+ const tweet = queryString.split('/').pop();
+
+ return Response.redirect(`https://threadreaderapp.com/thread/${tweet}`);
+}
+
+addEventListener('fetch', event => {
+ event.respondWith(handleRequest(event.request));
+})
--- /dev/null
+{
+ "name": "unroll",
+ "version": "0.1.0",
+ "description": "Redirects a tweet thread to the corresponding Threadreader thread.",
+ "private": true,
+ "main": "index.js",
+ "scripts": {
+ "login": "wrangler login",
+ "dev": "wrangler dev",
+ "preview": "wrangler preview",
+ "build": "wrangler build",
+ "publish": "wrangler publish"
+ },
+ "author": "Ardis Lu",
+ "license": "ISC",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/ardislu/cloudflare-workers.git"
+ }
+}
--- /dev/null
+name = 'unroll'
+type = 'javascript'
+account_id = ''
+workers_dev = true
+route = 'example.com/*'