All Projects → docpad → docpad-plugin-feedr

docpad / docpad-plugin-feedr

Licence: other
Adds support for reading feeds to DocPad

Programming Languages

HTML
75241 projects
coffeescript
4710 projects

Projects that are alternatives of or similar to docpad-plugin-feedr

docpad-plugin-thumbnails
DocPad plugin that manages thumbnail generation of your image files
Stars: ✭ 18 (+0%)
Mutual labels:  docpad-plugin
docpad-plugin-cleanurls
Adds support for clean urls to DocPad
Stars: ✭ 21 (+16.67%)
Mutual labels:  docpad-plugin
docpad-plugin-inlinegui
Plugin that brings Web Write's Inline GUI/CMS to DocPad
Stars: ✭ 14 (-22.22%)
Mutual labels:  docpad-plugin
docpad-plugin-sass
Adds support for the SASS and SCSS CSS pre-processors to DocPad. It also supports the Compass framework.
Stars: ✭ 13 (-27.78%)
Mutual labels:  docpad-plugin

Feedr Plugin for DocPad

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

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 module.

Install

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:

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:

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

     <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%>
     			</a>
     		</li>
     	<% end %>
     </ul>
  • Using CoffeeKup

     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?

GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

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:

and licensed under:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].