{ "updatedAt": "2026-05-27T23:47:30.991Z", "createdAt": "2026-05-27T22:09:54.846Z", "id": "JqX7ejCYX1oAHvQ2", "name": "paywall-bypass", "description": null, "active": true, "isArchived": false, "nodes": [ { "id": "86fa097b-c230-484d-806d-45b421635c05", "name": "Every 5 Minutes", "type": "n8n-nodes-base.scheduleTrigger", "position": [ -800, 0 ], "parameters": { "rule": { "interval": [ { "field": "minutes", "minutesInterval": 5 } ] } }, "typeVersion": 1.2 }, { "id": "eb644570-cca3-4464-9b99-02084f199078", "name": "Get Miniflux Entries", "type": "n8n-nodes-base.httpRequest", "position": [ -360, 0 ], "parameters": { "url": "http://192.168.1.40:17002/v1/entries", "method": "GET", "options": {}, "sendQuery": true, "sendHeaders": true, "queryParameters": { "parameters": [ { "name": "status", "value": "unread" }, { "name": "limit", "value": "100" }, { "name": "order", "value": "published_at" }, { "name": "direction", "value": "desc" } ] }, "headerParameters": { "parameters": [ { "name": "X-Auth-Token", "value": "3f439f2db55967ed5acd83398214d2aa76124927cde07115d945b9282597fecb" } ] } }, "typeVersion": 4.2 }, { "id": "f8024262-3163-4cd9-8233-3c91bfddcb01", "name": "Process Entries", "type": "n8n-nodes-base.code", "position": [ -120, 0 ], "parameters": { "mode": "runOnceForAllItems", "jsCode": "const MINIFLUX_TOKEN = '3f439f2db55967ed5acd83398214d2aa76124927cde07115d945b9282597fecb';\nconst MINIFLUX_URL = 'http://192.168.1.40:17002';\n\nconst PAYWALL_NEWS = [\n 'spiegel.de','zeit.de','faz.net','sueddeutsche.de','handelsblatt.com',\n 'nytimes.com','wsj.com','ft.com','washingtonpost.com','thetimes.co.uk',\n 'wired.com','theatlantic.com','economist.com','bloomberg.com',\n 'hbr.org','foreignpolicy.com','newyorker.com','taz.de',\n 'telegraph.co.uk','businessinsider.com'\n];\n\nconst PAYWALL_SCIENCE = [\n 'nature.com','science.org','cell.com','nejm.org','thelancet.com',\n 'link.springer.com','springer.com','wiley.com','onlinelibrary.wiley.com',\n 'sciencedirect.com','pubs.acs.org','rsc.org','pubs.rsc.org',\n 'bmj.com','annualreviews.org','pnas.org',\n 'jamanetwork.com','ahajournals.org','tandfonline.com','academic.oup.com'\n];\n\nconst CONTENT_MIN = 800;\nconst ALREADY_PROCESSED = /[\\u{1F513}\\u{1F4D6}❌]$/u;\n\nfunction extractDoi(url) {\n let m = url.match(/doi\\.org\\/(10\\.\\d{4,}\\/[^\\s?#]+)/);\n if (m) return decodeURIComponent(m[1]);\n m = url.match(/\\/doi\\/(10\\.\\d{4,}\\/[^\\s?#]+)/);\n if (m) return decodeURIComponent(m[1].replace(/[?#].*$/, ''));\n return null;\n}\n\nfunction hostname(url) {\n try { return new URL(url).hostname.replace(/^www\\./, ''); } catch { return ''; }\n}\n\nfunction badge(source, type) {\n if (source === 'unpaywall') return '

🔓 Open access via Unpaywall

';\n if (type === 'science') return '

📖 Full text via crawl4ai (not OA)

';\n return '

📖 Paywall bypass via crawl4ai

';\n}\n\nconst entries = $('Get Miniflux Entries').first().json.entries || [];\nconst results = [];\nconst stats = { skipped_processed: 0, skipped_nopaywall: 0, fetched: 0, failed: 0, updated: 0 };\n\nfor (const e of entries) {\n if (ALREADY_PROCESSED.test(e.title)) { stats.skipped_processed++; continue; }\n\n const host = hostname(e.url);\n const isScience = PAYWALL_SCIENCE.some(d => host === d || host.endsWith('.' + d));\n const isNews = PAYWALL_NEWS.some(d => host === d || host.endsWith('.' + d));\n const isShort = (e.content || '').replace(/<[^>]+>/g, '').trim().length < CONTENT_MIN;\n\n if (!isScience && !isNews && !isShort) { stats.skipped_nopaywall++; continue; }\n\n const type = isScience ? 'science' : isNews ? 'news' : 'short';\n let fetchUrl = e.url;\n let source = 'crawl4ai';\n\n if (isScience) {\n const doi = extractDoi(e.url);\n if (doi) {\n try {\n const up = await this.helpers.httpRequest({\n method: 'GET',\n url: `https://api.unpaywall.org/v2/${encodeURIComponent(doi)}?email=fkrebs@nucli.de`,\n json: true,\n });\n if (up.is_oa && up.best_oa_location) {\n const oaUrl = up.best_oa_location.url || up.best_oa_location.url_for_pdf;\n if (oaUrl) { fetchUrl = oaUrl; source = 'unpaywall'; }\n }\n } catch (_) {}\n }\n }\n\n let fullContent = '';\n let crawlErr = '';\n try {\n const cr = await this.helpers.httpRequest({\n method: 'POST',\n url: 'http://mcp-crawl4ai:11235/md',\n headers: { 'Content-Type': 'application/json' },\n body: { url: fetchUrl, filter: 'fit' },\n json: true,\n });\n if (cr && cr.success && cr.markdown) {\n fullContent = '

' + cr.markdown.replace(/\\n\\n/g, '

').replace(/\\n/g, '
') + '

';\n stats.fetched++;\n } else {\n crawlErr = 'no_markdown';\n }\n } catch (err) {\n crawlErr = String(err).slice(0, 200);\n }\n\n if (!fullContent) {\n stats.failed++;\n const failTitle = e.title.replace(/\\s[\\u{1F513}\\u{1F4D6}❌]$/u, '') + ' ❌';\n try {\n await this.helpers.httpRequest({\n method: 'PUT',\n url: `${MINIFLUX_URL}/v1/entries/${e.id}`,\n headers: { 'X-Auth-Token': MINIFLUX_TOKEN, 'Content-Type': 'application/json' },\n body: { title: failTitle },\n json: true,\n });\n } catch (_) {}\n results.push({ json: { entry_id: e.id, title: failTitle, status: 'no_content', source, type, error: crawlErr } });\n continue;\n }\n\n const finalContent = badge(source, type) + fullContent;\n const titleEmoji = source === 'unpaywall' ? '🔓' : '📖';\n const newTitle = e.title.replace(/\\s[\\u{1F513}\\u{1F4D6}❌]$/u, '') + ' ' + titleEmoji;\n\n try {\n await this.helpers.httpRequest({\n method: 'PUT',\n url: `${MINIFLUX_URL}/v1/entries/${e.id}`,\n headers: { 'X-Auth-Token': MINIFLUX_TOKEN, 'Content-Type': 'application/json' },\n body: { content: finalContent, title: newTitle },\n json: true,\n });\n stats.updated++;\n results.push({ json: { entry_id: e.id, title: newTitle, status: 'updated', source, type } });\n } catch (err) {\n results.push({ json: { entry_id: e.id, title: e.title, status: 'update_error', error: String(err).slice(0, 200), source, type } });\n }\n}\n\nresults.push({ json: { stats } });\nreturn results;" }, "typeVersion": 2 } ], "connections": { "Every 5 Minutes": { "main": [ [ { "node": "Get Miniflux Entries", "type": "main", "index": 0 } ] ] }, "Get Miniflux Entries": { "main": [ [ { "node": "Process Entries", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "staticData": { "node:Every 5 Minutes": { "recurrenceRules": [] } }, "meta": null, "pinData": null, "versionId": "0a3f5003-653c-4494-96e9-a779815a1b9c", "activeVersionId": "0a3f5003-653c-4494-96e9-a779815a1b9c", "versionCounter": 17, "triggerCount": 1, "tags": [], "shared": [ { "updatedAt": "2026-05-27T22:09:54.846Z", "createdAt": "2026-05-27T22:09:54.846Z", "role": "workflow:owner", "workflowId": "JqX7ejCYX1oAHvQ2", "projectId": "hkIaTyp1CKVS8ywT", "project": { "updatedAt": "2026-03-09T07:21:36.510Z", "createdAt": "2026-03-09T07:20:59.502Z", "id": "hkIaTyp1CKVS8ywT", "name": "Florian Krebs ", "type": "personal", "icon": null, "description": null, "creatorId": "8af5c813-f89c-4b83-bcf8-5d59864a038a" } } ], "versionMetadata": { "name": "paywall-bypass", "description": null } }