Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/docpad/docpad-plugin-feedr
Adds support for reading feeds to DocPad
https://github.com/docpad/docpad-plugin-feedr
docpad-plugin
Last synced: 25 days ago
JSON representation
Adds support for reading feeds to DocPad
- Host: GitHub
- URL: https://github.com/docpad/docpad-plugin-feedr
- Owner: docpad
- License: other
- Created: 2012-10-17T11:40:00.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-01-08T01:41:31.000Z (about 1 year ago)
- Last Synced: 2024-12-08T05:08:42.428Z (about 1 month ago)
- Topics: docpad-plugin
- Language: HTML
- Homepage:
- Size: 215 KB
- Stars: 18
- Watchers: 14
- Forks: 5
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# [Feedr](https://github.com/bevry/feedr) Plugin for [DocPad](http://docpad.org)
This plugin is able to pull in remote json and xml feeds, convert them to JSON data, and expose them to `@feedr.feeds[feedName]` for your templates, via the [Feedr](https://github.com/bevry/feedr) module.
## Install
``` bash
docpad install feedr
```## Usage
### Setup
First we have to tell Feedr which feeds it should retrieve, you can do this by adding the following to your website's docpad configuration file:
``` coffeescript
plugins:
feedr:
feeds:
twitter:
url: "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=balupton&count=20&include_entities=true&include_rts=true"someOtherFeedName:
url: "someOtherFeedUrl"
```Feedr can also clean up responses like `"key": {"_content": "the actual value"}` (as used on Flickr) to the cleaner `"key": 'the actual value"`. To enable this set `clean` to `true` inside your feed configuration like so:
``` coffeescript
flickrUser:
url: "http://api.flickr.com/services/rest/?method=flickr.people.getInfo&api_key=#{FLICKR_API_KEY}&user_id=#{FLICKR_USER_ID}&format=json&nojsoncallback=1"
clean: true
```### Rendering
Then inside your templates, we would do something like the following to render the items:
- Using [Eco](https://github.com/sstephenson/eco)
``` coffeescript
-
<%=tweet.text%>
<% for tweet in @feedr.feeds.twitter: %>
<% continue if tweet.in_reply_to_user_id %>
<% end %>
```
- Using [CoffeeKup](http://coffeekup.org/)
``` coffeescript
ul ->
for tweet in @feedr.feeds.twitter
continue if tweet.in_reply_to_user_id
li datetime: tweet.created_at, ->
a href: "https://twitter.com/#!/#{tweet.user.screen_name}/status/#{tweet.id_str}", title: "View on Twitter", ->
tweet.text
```
History
Discover the release history by heading on over to the HISTORY.md
file.
Contribute
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
Backers
Maintainers
These amazing people are maintaining this project:
Sponsors
No sponsors yet! Will you be the first?
Contributors
These amazing people have contributed code to this project:
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
License
Unless stated otherwise all works are:
- Copyright © 2012+ Bevry Pty Ltd
and licensed under: