Re: Simplest easiest rss feeds?

2011-10-05 Thread Jenna Fox
That's cool! :D

—
Jenna

On 06/10/2011, at 3:48 AM, Bartosz Dziewoński wrote:

> I was only once generating an RSS feed, and I just did it with
> Markaby. You can see live example here:
> http://warlightrss.heroku.com/general - and the source code: (RSS
> generation is at the very bottom)
> http://warlightrss.heroku.com/source/web.rb
> 
> Also, don't judge, this is old (still just works, so I didn't mess
> with it for some time). ;)
> 
> -- Matma Rex
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Simplest easiest rss feeds?

2011-10-05 Thread Bartosz Dziewoński
I was only once generating an RSS feed, and I just did it with
Markaby. You can see live example here:
http://warlightrss.heroku.com/general - and the source code: (RSS
generation is at the very bottom)
http://warlightrss.heroku.com/source/web.rb

Also, don't judge, this is old (still just works, so I didn't mess
with it for some time). ;)

-- Matma Rex
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Helpers and R() routes

2011-10-05 Thread Magnus Holm
I've added a failing test:
https://github.com/camping/camping/commit/7aa0e1fa934806f964ad120c1b4bb21783c7e008

Will look into it later :-)

// Magnus Holm

On Wed, Oct 5, 2011 at 03:34, Jenna Fox  wrote:
> It'd be cool if in the next version of camping, you could use
> R(ControllerName, *args) inside of helper methods, rather than having to go
> all out with R(MyApp::Controllers::ControllerName, *args)
> —
> Jenna
>
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
>
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Simplest easiest rss feeds?

2011-10-05 Thread Jonathan Groll
On Wed, 5 Oct 2011 11:20:31 +1100, Jenna Fox  wrote:

> [1  ]
> [1.1  ]
> 
> [1.2  ]
> I'm looking to make rss feeds of some of my controller data - what's the
> simplest way to render some? Is there some way I can feed a json-like arrays
> of hashes type of structure in to some gem and get out an xml feed? Would it
> be more of a builder sort of operation?

An example. Succinct. RSS:Maker. For your reference. (from my blogging
engine written with Camping 1.9):

Firstly, need to require rss/maker, then
module Blogg::Controllers

  class Index < R '/', '/tag/([-\w]+)', '/(rss)', '/(rss)/([-\w]+)'
def get ( format='html', *rest )

...
then later on:

  # Produce RSS feed
  if format == 'rss'
content = RSS::Maker.make('2.0') do |m|
  m.channel.title = @@config[:title]
  m.channel.about = URL().to_s + '/rss'
  m.channel.link  = URL().to_s
  m.channel.description = @@config[:descr]
  m.items.do_sort = true # sort items by date

  for post in @posts
if post.okayed == true && tag_matches?(post, @tagg)
  i = m.items.new_item
  i.title = post.title
  i.link =  URL(View, post.slug).to_s
  i.guid.content = URL(View, post.id).to_s
  i.guid.isPermaLink = true
  ar = post.body.split(/^---!/)
  i.description = RedCloth.new(ar[1]).to_html
  i.description << RedCloth.new(ar[2]).to_html if (ar[2] != nil && 
ar[2] != "\r\n" && ar[2] != "")
  i.date = post.when
end
  end

end
r 200, content.to_s, 'Content-Type' => 'application/rss+xml; 
charset=UTF-8'

Notes: I use ---!  to mark a block at the beginning of a post  - this block
is the description of the post. Redcloth markdown is used.

Cheers,
Jonathan
--
jjg: Jonathan J. Groll : groll co za
has_one { :blog => "http://bloggroll.com"; }
Sent from my computer device which runs on free software
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Simplest easiest rss feeds?

2011-10-05 Thread Magnus Holm
On Wed, Oct 5, 2011 at 02:20, Jenna Fox  wrote:
> I'm looking to make rss feeds of some of my controller data - what's the
> simplest way to render some? Is there some way I can feed a json-like arrays
> of hashes type of structure in to some gem and get out an xml feed? Would it
> be more of a builder sort of operation?
>
> —
> Jenna

I haven't tried the RSS generator, so I don't know how well it works,
but I've been doing this:
https://github.com/judofyr/timeless/blob/master/timeless/views/feed.erb
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list