[Rails] Re: Re: Re: Parsing XML file with no style info with Hpricot

2010-03-08 Thread Allan Last
Thanks everybody. I saw the info on the source. I figured it out. -A Hassan Schroeder wrote: On Sun, Mar 7, 2010 at 10:18 AM, Allan Last li...@ruby-forum.com wrote: I'm expecting the XML information seen here on Firefox: / to be displayed when I parse the MLB file. Hpricot is not parsing

[Rails] Parsing XML file with no style info with Hpricot

2010-03-07 Thread Allan Last
Hello, I've been trying for hours to parse an XML using Hpricot. Usually it's not a problem. Here's my simple code: #This works and outputs the proper xml data @url1 = 'http://www.sportingnews.com/stories/sportingnews/MLB/rss.xml' @page1 = Hpricot(open(@url1)) %= @page 1 % #This does not work,

[Rails] Re: Parsing XML file with no style info with Hpricot

2010-03-07 Thread Allan Last
Any idea how to parse this XML? -A Allan Last wrote: Hello, I've been trying for hours to parse an XML using Hpricot. Usually it's not a problem. Here's my simple code: #This works and outputs the proper xml data @url1 = 'http://www.sportingnews.com/stories/sportingnews/MLB/rss.xml

[Rails] Re: Parsing XML file with no style info with Hpricot

2010-03-07 Thread Allan Last
= Hpricot(open(@url1)) %= @page1 % Hassan Schroeder wrote: On Sun, Mar 7, 2010 at 4:10 AM, Allan Last li...@ruby-forum.com wrote: #This does not work, and I'm scratching my head And I'm scratching mine trying to guess what you mean by does not work ... -- Hassan Schroeder

[Rails] Re: Re: Parsing XML file with no style info with Hpricot

2010-03-07 Thread Allan Last
is not parsing this file. -A Hassan Schroeder wrote: On Sun, Mar 7, 2010 at 9:39 AM, Allan Last li...@ruby-forum.com wrote: If you give my code a quick try, you'll notice that it will read other XML files, but not the MLB XML. Actually, I already did, and it seems to work just fine. Hence my own

[Rails] Re: RegEx help to detect First and Last name

2010-03-05 Thread Allan Last
Thanks for the suggestions. I'm going to play around with this. On the most part, I'm doing detection for scenarios with two names, so names like Robert De Niro will not come up. -A Rick Denatale wrote: On Fri, Mar 5, 2010 at 12:16 PM, Hassan Schroeder hassan.schroe...@gmail.com wrote: You

[Rails] Embedded expressions in ERB

2010-03-04 Thread Allan Last
I'm stuck in trying to get an embedded expression in ERB. I'm trying to put @post into @httppost. However when I print @httppost I get (notice the @post): {aps: {badge: 1, alert, #...@post}}, sound: cat.caf, device_tokens: [455ab1b23cbfd97b7d2ef90a49d222e40f4c6c9b2570e84ff94fe4afeea12345]} It

[Rails] Re: Embedded expressions in ERB

2010-03-04 Thread Allan Last
Philip, Thanks a lot! This really helped me! -A Philip Hallstrom wrote: On Mar 4, 2010, at 4:27 PM, Allan Last wrote: It should say: post params: %= @post % br / % @httppost = '{aps: {badge: 1, alert, #...@post}}, sound: cat.caf, device_tokens

[Rails] RegEx help to detect First and Last name

2010-03-04 Thread Allan Last
Hello, I need some help on RegEx to detect First and Last names. This is what I currently have: /([A-Z]+[a-zA-Z]* [A-Z]+[a-zA-Z]*)/ This is used to detect a First and Last name where two words are next to each other that begin with a capital letter. So it will detect: John Smith Jane Smith I

[Rails] Using gsub to replace text with link from database

2010-03-03 Thread Allan Last
I'm really close to solving this that I can smell it. In a nutshell I'm trying to create this: http://www.baseball-reference.com/friv/link_players.cgi I have an app that has a database of baseball players. I'm trying to create a feature where you can copy and paste your blog text, the feature