Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Query web feeds (RSS, Atom, and RDF) with GraphQL

License

NotificationsYou must be signed in to change notification settings

adieuadieu/graphql-web-feeds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reconciling old shit with new shit; Query web feeds (RSS, Atom, and RDF) with GraphQL

Contents

  1. What is it?
  2. Try it
  3. Installation
  4. Querying
  5. Configuration
  6. Testing
  7. Troubleshooting

What is it?

Sometimes you gotta make use of an RSS/Atom/RDF web feed.graphql-web-feeds aims to make it easy to do that in your GraphQL API.

Try it

Demo Todo :-(

Features / Roadmap-todo

  • make it do something
  • S3 cache, use S3 expiration to expire based on RSS TTL
  • aggregate multiple feeds into one, sorted by date (at the detriment of speed?)
  • offer an Atom/RDF/RSS Interface type ?

Installation

The package makes the assumption that, because you're using GraphQL, you're probably also using ES6+ and therefore your project handles any necessary transpilation, when required.

First, install the package:

npm install graphql-web-feeds --save

Then, add it to your project's GraphQL schema:

import{GraphQLSchema}from'graphql/type'import{feedTypeFactory}from'web-feeds-graphql'constsimpleField=feedTypeFactory()constschema=GraphQLSchema({query:simpleField,})
query {waitButWhy:feed(url:"http://waitbutwhy.com/feed") {titlelinkdescriptionitems {titlelinkdescription    }  }}

Single, default feed:

import{GraphQLSchema}from'graphql/type'import{feedTypeFactory}from'web-feeds-graphql'constfeedUrl='http://waitbutwhy.com/feed'constfield=feedTypeFactory(feedUrl)constschema=GraphQLSchema({query:field,})
query {feed {titlelinkdescriptionitems {titlelinkdescription    }  }}

With cache and selected feeds:

import{GraphQLSchema}from'graphql/type'import{S3Cache}from'web-feeds-graphql/cache'import{feedTypeFactory}from'web-feeds-graphql'constcache=newS3Cache({ secret, accesskey,ttl:true,..etc})constfeeds={waitButWhy:'http://waitbutwhy.com/feed',spacex:'http://www.space.com/home/feed/site.xml',}constfield=feedTypeFactory(feeds,cache)constschema=GraphQLSchema({query:field,})
query {waitButWhy:feed(name: waitButWhy) {titlelinkdescriptionitems {titlelinkdescription    }  }}

Querying

query {waitButWhy:feed(url:"http://waitbutwhy.com/feed") {titlelinkdescriptionitems {titlelinkdescription    }  }}

Configuration

Todo

Custom Feed Caches

Todo

Cache must be an object exposing two methods:get andset

stream get(feedUrl)

async set(feedUrl, feedStream)

Testing

git clone https://github.com/adieuadieu/graphql-web-feeds.gitcd graphql-web-feedsnpmtest

FAQ / Troubleshooting

Todo? Todo.

About

Query web feeds (RSS, Atom, and RDF) with GraphQL

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp