sustainability-fulltext-fetch
Skill11 starsChanged 3 months agoMITView on GitHub
Fetch and persist content for DOI-keyed sustainability RSS entries from a separate fulltext SQLite DB, using OpenAlex/Semantic Scholar API metadata first and webpage fulltext extraction as fallback. Use when building resilient DOI-first content enrichment after relevance labeling.
- Reads credentials
In this repository62 other files it gives its agents.
- AGENTS.mdAGENTS.md
- academic-paper-downloadSkill
- airnow-hourly-obs-fetchSkill
- ai-tech-fulltext-fetchSkill
- ai-tech-rss-fetchSkill
- ai-tech-summarySkill
- apply-environmental-thinkingSkill
- bluesky-cascade-fetchSkill
- convert-image-to-jpgSkill
- dify-knowledge-base-searchSkill
- dify-knowledge-base-uploadSkill
- document-granular-decomposeSkill
- domain-onboardingSkill
- eceee-news-fulltext-fetchSkill
- email-imap-appendSkill
- email-imap-fetchSkill
- email-imap-full-fetchSkill
- email-smtp-sendSkill
- epa-eis-records-fetchSkill
- federal-register-doc-fetchSkill
- fetch-abstract-to-kbSkill
- fetch-meta-from-kbSkill
- fetch-meta-to-kbSkill
- figshare-data-downloadSkill
- gdelt-doc-searchSkill
- gdelt-events-fetchSkill
- gdelt-gkg-fetchSkill
- gdelt-mentions-fetchSkill
- gdelt-web-ngrams-searchSkill
- github-contribution-period-analysisSkill
- nasa-firms-fire-fetchSkill
- notebooklmSkill
- openaq-data-fetchSkill
- open-meteo-air-quality-fetchSkill
- open-meteo-flood-fetchSkill
- open-meteo-historical-fetchSkill
- regulationsgov-attachments-fetchSkill
- regulationsgov-comment-detail-fetchSkill
- regulationsgov-comments-fetchSkill
- remove-similar-imageSkill
- river-outfall-status-visualizerSkill
- sustainability-rss-fetchSkill
- sustainability-summarySkill
- synology-file-stationSkill
- tiangong-auto-researchSkill
- tiangong-auto-research-workbuddySkill
- tiangong-kb-course-fulltext-fetchSkill
- tiangong-kb-course-searchSkill
- tiangong-kb-edu-searchSkill
- tiangong-kb-esg-searchSkill
- tiangong-kb-ingestSkill
- tiangong-kb-patent-searchSkill
- tiangong-kb-report-searchSkill
- tiangong-kb-sci-searchSkill
- tiangong-kb-textbook-searchSkill
- tsinghua-graduate-thesisSkill
- usbr-project-records-fetchSkill
- usbr-rise-fetchSkill
- use-thuenv-presentation-styleSkill
- usgs-water-iv-fetchSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Read relevant DOI entries from RSS metadata DB.
- Distinctive: line 10
Write fetched content into a separate fulltext DB.
- Distinctive: line 12
Prefer API metadata retrieval by DOI (OpenAlex first, Semantic Scholar fallback).
- Distinctive: line 22
Ensure upstream DOI/relevance data exists.
- Distinctive: line 30
Run incremental sync (API first, webpage fallback).
- Very specific: line 74
If accepted (--api-min-chars), persist as content_kind=abstract.
- Very specific: line 77
Use canonical_url then url.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sustainability Fulltext Fetch
Core Goal
- Read relevant DOI entries from RSS metadata DB.
- Write fetched content into a separate fulltext DB.
- Process only relevant entries (
is_relevant=1). - Prefer API metadata retrieval by DOI (OpenAlex first, Semantic Scholar fallback).
- Fallback to webpage fulltext extraction when API metadata is unavailable.
- Persist one content row per DOI in
entry_content.
Triggering Conditions
- Receive a request to enrich relevant DOI records with abstract/fulltext content.
- Receive a request to replace webpage-first crawling with API-first enrichment.
- Need retry-safe incremental updates without duplicate rows.
Workflow
- Ensure upstream DOI/relevance data exists.
export SUSTAIN_RSS_DB_PATH="/absolute/path/to/workspace-rss-bot/sustainability_rss.db"
export SUSTAIN_FULLTEXT_DB_PATH="/absolute/path/to/workspace-rss-bot/sustainability_fulltext.db"
python3 scripts/fulltext_fetch.py init-db --content-db "$SUSTAIN_FULLTEXT_DB_PATH"- Run incremental sync (API first, webpage fallback).
python3 scripts/fulltext_fetch.py sync \
--rss-db "$SUSTAIN_RSS_DB_PATH" \
--content-db "$SUSTAIN_FULLTEXT_DB_PATH" \
--limit 50 \
--openalex-email "you@example.com" \
--api-min-chars 80 \
--min-chars 300- Fetch one DOI on demand.
python3 scripts/fulltext_fetch.py fetch-entry \
--rss-db "$SUSTAIN_RSS_DB_PATH" \
--content-db "$SUSTAIN_FULLTEXT_DB_PATH" \
--doi "10.1038/nature12373"- Inspect stored content state.
python3 scripts/fulltext_fetch.py list-content \
--rss-db "$SUSTAIN_RSS_DB_PATH" \
--content-db "$SUSTAIN_FULLTEXT_DB_PATH" \
--status ready \
--limit 100Data Contract
- Reads from RSS DB
entries:doi,doi_is_surrogate,is_relevant,canonical_url,url,title.
- Writes to fulltext DB
entry_content(primary keydoi):- source URL/status/extractor
content_kind(abstractorfulltext)content_text,content_hash,content_length- retry fields and timestamps.
Extraction Priority
- API metadata path:
- OpenAlex by DOI.
- Semantic Scholar fallback by DOI.
- If accepted (
--api-min-chars), persist ascontent_kind=abstract.
- Webpage fallback path:
- Use
canonical_urlthenurl. - Extract with
trafilaturawhen available, else built-in HTML parser. - Persist as
content_kind=fulltext.
Update Semantics
- Upsert key:
doi. - Success: status
ready, reset retry counters. - Failure with existing ready row: keep old content, record latest error.
- Failure without ready row: set
status=failed, increment retry state.
Configurable Parameters
--rss-db--content-dbSUSTAIN_RSS_DB_PATHSUSTAIN_FULLTEXT_DB_PATH--limit--force--only-failed--refetch-days--timeout--max-bytes--min-chars--openalex-email/OPENALEX_EMAIL--s2-api-key/S2_API_KEY--api-timeout--api-min-chars--disable-api-metadata--max-retries--retry-backoff-minutes--user-agent--disable-trafilatura--fail-on-errors
Error Handling
- Missing DOI-keyed
entriestable: stop with actionable message. - RSS DB and fulltext DB path collision: fail fast and require separate files.
- API/network/HTTP failures: record failures and continue queue.
- Webpage non-text content: mark failed for that DOI.
- Short extraction: fail by threshold to avoid low-quality content.
References
references/schema.mdreferences/fetch-rules.md
Assets
assets/config.example.json
Scripts
scripts/fulltext_fetch.py
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

