Created
April 10, 2011 16:06
-
-
Save phaer/912466 to your computer and use it in GitHub Desktop.
Simple Jekyll tag which displays the notices in a given status.net/ostatus feed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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