Sean O'Halpin
3/28/2009 1:06:00 PM
On Sat, Mar 28, 2009 at 11:44 AM, Arun Kumar
<arunkumar@innovaturelabs.com> wrote:
> Hi,
> You have completely misunderstood me. I'm working as a software engineer
> trainee right now. The first problem that i had has been solved. Now it
> is a new assignment. To tell frankly. I have just 2 weeks of experience
> in ruby and there is nobody right here that have knwledge about ruby.
> That is why i'm asking a favour through this community. I'm sorry if i'm
> troubling u guys so much.
If I have misrepresented you, then you have my sincerest apologies.
However, you have not really represented your own position terribly
well. Now that we know you are a trainee with little experience who is
currently specifically being trained in regular expressions, it makes
more sense that you cannot use REXML, etc. But this was not clear from
your previous posts.
By the way, you are more likely to get a positive response if you at
least show how far you have got with the problem yourself before
coming to the list.
And to make up for my grouchy mood this morning, here's my contribution:
hashes = []
data.scan(/<link[^>]+?>/) do |link|
hashes << Hash[*link.scan(/([a-z]+)=["']?([^"]+)["']?/).flatten]
end
require 'pp'
pp hashes.select{ |hash| hash["type"] == "application/rss+xml" }
But I have no idea if this will meet the requirements of your
assignment or if you will understand it.
Regards,
Sean