Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Adds support for reading feeds to DocPad

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src v2.6.0. Improvement October 02, 2013
Octocat-spinner-32 test fixed test plugins always installing October 27, 2013
Octocat-spinner-32 .gitignore v2.7.0. Improvement. Bugfix. January 10, 2014
Octocat-spinner-32 .npmignore v2.7.0. Improvement. Bugfix. January 10, 2014
Octocat-spinner-32 .travis.yml v2.7.0. Improvement. Bugfix. January 10, 2014
Octocat-spinner-32 CONTRIBUTING.md v2.7.0. Improvement. Bugfix. January 10, 2014
Octocat-spinner-32 Cakefile v2.7.0. Improvement. Bugfix. January 10, 2014
Octocat-spinner-32 HISTORY.md v2.7.0. Improvement. Bugfix. January 10, 2014
Octocat-spinner-32 LICENSE.md v2.7.0. Improvement. Bugfix. January 10, 2014
Octocat-spinner-32 README.md v2.7.0. Improvement. Bugfix. January 10, 2014
Octocat-spinner-32 package.json v2.7.0. Improvement. Bugfix. January 10, 2014
README.md

Feedr Plugin for DocPad

Build Status NPM version Dependency Status Development Dependency Status
Gittip donate button Flattr donate button PayPayl donate button BitCoin donate 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 change 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?

Gittip donate button Flattr donate button PayPayl donate button BitCoin donate button

Contributors

These amazing people have contributed code to this project:

Become a contributor!

License

Licensed under the incredibly permissive MIT license

Copyright © 2012+ Bevry Pty Ltd us@bevry.me (http://bevry.me)

Something went wrong with that request. Please try again.