Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Simple Jekyll tag which displays the notices in a given status.net/ostatus feed.
require 'date'
require 'ostatus'
module Jekyll
class RenderOStatus < Liquid::Tag
def render(context)
site = context.registers[:site]
feed = OStatus::Feed.from_url(site.config['ostatus_feed'])
result = "<h2>#{feed.author.name}'s microblog</h2>"
result << "<ul class=\"ostatus\">"
feed.entries.each do |entry|
result << "<li>#{entry.content}</li>"
end
result << "</ul>"
result.force_encoding('utf-8')
end
end
end
Liquid::Template.register_tag('ostatus', Jekyll::RenderOStatus)
@teiko

This comment has been minimized.

Show comment Hide comment
@teiko

teiko Oct 29, 2011

Have you got a README for implementing it?

teiko commented Oct 29, 2011

Have you got a README for implementing it?

@phaer

This comment has been minimized.

Show comment Hide comment
@phaer

phaer Oct 30, 2011

Not really, but i don't think you need one. Just look at a few other jekyll tags and maybe at the tests or source of https://github.com/hotsh/ostatus . If you just want to use it on your jekyll site put it in your _plugins directory (see https://github.com/mojombo/jekyll/wiki/Plugins) but keep in mind that it generates a static html file when you run jekyll, no live updates or anything like that. Any more specific questions?

Owner

phaer commented Oct 30, 2011

Not really, but i don't think you need one. Just look at a few other jekyll tags and maybe at the tests or source of https://github.com/hotsh/ostatus . If you just want to use it on your jekyll site put it in your _plugins directory (see https://github.com/mojombo/jekyll/wiki/Plugins) but keep in mind that it generates a static html file when you run jekyll, no live updates or anything like that. Any more specific questions?

@phaer

This comment has been minimized.

Show comment Hide comment
@phaer

phaer Jan 25, 2012

And it needs ostatus_feed in your _config.yml set to your ostatus atom feed.

Owner

phaer commented Jan 25, 2012

And it needs ostatus_feed in your _config.yml set to your ostatus atom feed.

@teiko

This comment has been minimized.

Show comment Hide comment
@teiko

teiko Jan 29, 2012

Thanks.
I've found another solution for my needs, but I'll bear that one in mind.
I'll integrate that later with another feed

teiko commented Jan 29, 2012

Thanks.
I've found another solution for my needs, but I'll bear that one in mind.
I'll integrate that later with another feed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment