I''m really struggling to find some information about extracting relevant information from my hash output from twitter. My model contains: def timeline @timeline = client.home_timeline end And my view: <%= @user.twitter_token.timeline.each do |t| %> <%= t.text %> <br> <% end %> I was hoping to extract just my text from the hashie but it doesn''t quite work... I get my tweets on separate lines which is great, followed by the hash again... [<#Hashie::Mash contributors=nil coordinates=nil created_at="Wed May 04 18:57:32 +0000 2011" favorited=false geo=nil id=65852579048980480 id_str="65852579048980480" in_reply_to_screen_name=nil in_reply_to_status_id=nil in_reply_to_status_id_str=nil in_reply_to_user_id=nil in_reply_to_user_id_str=nil place=nil retweet_count=0 retweeted=false source="web" text="what''s happening?" truncated=false user= ... How on earth can I stop this?! Thanks, Simon -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 12, 9:23 am, simonm <si...-7ev/j6XIf0kRmelmmXo44Q@public.gmane.org> wrote:> I''m really struggling to find some information about extracting > relevant information from my hash output from twitter. > > My model contains: > > def timeline > @timeline = client.home_timeline > end > > And my view: > > <%= @user.twitter_token.timeline.each do |t| %>Don''t use <%= here - it will dump the result of the expression (which in the case of .each is the entire collection that was iterated over) into the view, which isn''t what you want Fred> <%= t.text %> > <br> > <% end %> > > I was hoping to extract just my text from the hashie but it doesn''t > quite work... I get my tweets on separate lines which is great, > followed by the hash again... > > [<#Hashie::Mash contributors=nil coordinates=nil created_at="Wed May > 04 18:57:32 +0000 2011" favorited=false geo=nil id=65852579048980480 > id_str="65852579048980480" in_reply_to_screen_name=nil > in_reply_to_status_id=nil in_reply_to_status_id_str=nil > in_reply_to_user_id=nil in_reply_to_user_id_str=nil place=nil > retweet_count=0 retweeted=false source="web" text="what''s happening?" > truncated=false user= ... > > How on earth can I stop this?! > > Thanks, > > Simon-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Many thanks for the response. I''ve changed my view to this and I now can''t see the recent tweets but am left with the hash still. Why am I finding this so complicated!?! <%= @user.twitter_token.timeline.each do |t| %> <% t.text %> <br> <% end %> Simon On May 12, 11:55 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On May 12, 9:23 am, simonm <si...-7ev/j6XIf0kRmelmmXo44Q@public.gmane.org> wrote: > > > I''m really struggling to find some information about extracting > > relevant information from my hash output from twitter. > > > My model contains: > > > def timeline > > @timeline = client.home_timeline > > end > > > And my view: > > > <%= @user.twitter_token.timeline.each do |t| %> > > Don''t use <%= here - it will dump the result of the expression (which > in the case of .each is the entire collection that was iterated over) > into the view, which isn''t what you want > > Fred > > > > > > > > > <%= t.text %> > > <br> > > <% end %> > > > I was hoping to extract just my text from the hashie but it doesn''t > > quite work... I get my tweets on separate lines which is great, > > followed by the hash again... > > > [<#Hashie::Mash contributors=nil coordinates=nil created_at="Wed May > > 04 18:57:32 +0000 2011" favorited=false geo=nil id=65852579048980480 > > id_str="65852579048980480" in_reply_to_screen_name=nil > > in_reply_to_status_id=nil in_reply_to_status_id_str=nil > > in_reply_to_user_id=nil in_reply_to_user_id_str=nil place=nil > > retweet_count=0 retweeted=false source="web" text="what''s happening?" > > truncated=false user= ... > > > How on earth can I stop this?! > > > Thanks, > > > Simon-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 12, 12:29 pm, simonm <si...-7ev/j6XIf0kRmelmmXo44Q@public.gmane.org> wrote:> Hi > > Many thanks for the response. I''ve changed my view to this and I now > can''t see the recent tweets but am left with the hash still. Why am I > finding this so complicated!?! >You removed the wrong equals Fred> <%= @user.twitter_token.timeline.each do |t| %> > <% t.text %> > <br> > <% end %> > > Simon > > On May 12, 11:55 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > On May 12, 9:23 am, simonm <si...-7ev/j6XIf0kRmelmmXo44Q@public.gmane.org> wrote: > > > > I''m really struggling to find some information about extracting > > > relevant information from my hash output from twitter. > > > > My model contains: > > > > def timeline > > > @timeline = client.home_timeline > > > end > > > > And my view: > > > > <%= @user.twitter_token.timeline.each do |t| %> > > > Don''t use <%= here - it will dump the result of the expression (which > > in the case of .each is the entire collection that was iterated over) > > into the view, which isn''t what you want > > > Fred > > > > <%= t.text %> > > > <br> > > > <% end %> > > > > I was hoping to extract just my text from the hashie but it doesn''t > > > quite work... I get my tweets on separate lines which is great, > > > followed by the hash again... > > > > [<#Hashie::Mash contributors=nil coordinates=nil created_at="Wed May > > > 04 18:57:32 +0000 2011" favorited=false geo=nil id=65852579048980480 > > > id_str="65852579048980480" in_reply_to_screen_name=nil > > > in_reply_to_status_id=nil in_reply_to_status_id_str=nil > > > in_reply_to_user_id=nil in_reply_to_user_id_str=nil place=nil > > > retweet_count=0 retweeted=false source="web" text="what''s happening?" > > > truncated=false user= ... > > > > How on earth can I stop this?! > > > > Thanks, > > > > Simon-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ah. Got it by removing the = from the first statement... On 12 May 2011, at 11:55, Frederick Cheung wrote:> > > On May 12, 9:23 am, simonm <si...-7ev/j6XIf0kRmelmmXo44Q@public.gmane.org> wrote: >> I''m really struggling to find some information about extracting >> relevant information from my hash output from twitter. >> >> My model contains: >> >> def timeline >> @timeline = client.home_timeline >> end >> >> And my view: >> >> <%= @user.twitter_token.timeline.each do |t| %> > > Don''t use <%= here - it will dump the result of the expression (which > in the case of .each is the entire collection that was iterated over) > into the view, which isn''t what you want > > Fred >> <%= t.text %> >> <br> >> <% end %> >> >> I was hoping to extract just my text from the hashie but it doesn''t >> quite work... I get my tweets on separate lines which is great, >> followed by the hash again... >> >> [<#Hashie::Mash contributors=nil coordinates=nil created_at="Wed May >> 04 18:57:32 +0000 2011" favorited=false geo=nil id=65852579048980480 >> id_str="65852579048980480" in_reply_to_screen_name=nil >> in_reply_to_status_id=nil in_reply_to_status_id_str=nil >> in_reply_to_user_id=nil in_reply_to_user_id_str=nil place=nil >> retweet_count=0 retweeted=false source="web" text="what''s happening?" >> truncated=false user= ... >> >> How on earth can I stop this?! >> >> Thanks, >> >> Simon > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >--------------------------------------------------------------------------------------- The information contained in this email and its attachments is confidential and may be the subject of legal, professional or other privilege. It is intended only for the named addressees and may not be disclosed to anyone else without consent from PolkaSpots Limited. If you are not the named addressee you must not use, disclose, distribute, copy, print or rely on the contents of this email and should destroy it immediately. Whilst PolkaSpots Limited takes care to protect its systems from electronic virus attack or other harmful event, the firm gives no warranty that this email message (including any attachments to it) is free of any virus or other harmful matter and accepts no responsibility for any loss or damage resulting from the recipient receiving, opening or using it. If you need any further information, please contact the originator of this message on +44 (0) 20 7183 1471. PolkaSpots Limited is registered in the UK, number 05508105. Registered Office: 204 Buspace Studios, Conlan Street, London W10 5AP Website: www.polkaspots.com --------------------------------------------------------------------------------------- -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sorry, didn''t see this! Thanks for the help. Am now stuck on sorting foursquare''s hashie out. Seems like the same format but I get nothing out of the hash when I do this: <% @user.foursquare_token.checkins.each do |c| %> <%= c.display %> <% end %> Seems a bit illogical... [<#Hashie::Mash created="Thu, 12 May 11 12:53:30 +0000" display="xxx xxx S. @ Buspace Studio" id=634678877 ..... Shouldn''t that output: xxx xxx Thanks again Simon On 12 May 2011, at 13:42, Frederick Cheung wrote:> > > On May 12, 12:29 pm, simonm <si...-7ev/j6XIf0kRmelmmXo44Q@public.gmane.org> wrote: >> Hi >> >> Many thanks for the response. I''ve changed my view to this and I now >> can''t see the recent tweets but am left with the hash still. Why am I >> finding this so complicated!?! >> > > You removed the wrong equals > > Fred >> <%= @user.twitter_token.timeline.each do |t| %> >> <% t.text %> >> <br> >> <% end %> >> >> Simon >> >> On May 12, 11:55 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> >> >> >>> On May 12, 9:23 am, simonm <si...-7ev/j6XIf0kRmelmmXo44Q@public.gmane.org> wrote: >> >>>> I''m really struggling to find some information about extracting >>>> relevant information from my hash output from twitter. >> >>>> My model contains: >> >>>> def timeline >>>> @timeline = client.home_timeline >>>> end >> >>>> And my view: >> >>>> <%= @user.twitter_token.timeline.each do |t| %> >> >>> Don''t use <%= here - it will dump the result of the expression (which >>> in the case of .each is the entire collection that was iterated over) >>> into the view, which isn''t what you want >> >>> Fred >> >>>> <%= t.text %> >>>> <br> >>>> <% end %> >> >>>> I was hoping to extract just my text from the hashie but it doesn''t >>>> quite work... I get my tweets on separate lines which is great, >>>> followed by the hash again... >> >>>> [<#Hashie::Mash contributors=nil coordinates=nil created_at="Wed May >>>> 04 18:57:32 +0000 2011" favorited=false geo=nil id=65852579048980480 >>>> id_str="65852579048980480" in_reply_to_screen_name=nil >>>> in_reply_to_status_id=nil in_reply_to_status_id_str=nil >>>> in_reply_to_user_id=nil in_reply_to_user_id_str=nil place=nil >>>> retweet_count=0 retweeted=false source="web" text="what''s happening?" >>>> truncated=false user= ... >> >>>> How on earth can I stop this?! >> >>>> Thanks, >> >>>> Simon > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >--------------------------------------------------------------------------------------- The information contained in this email and its attachments is confidential and may be the subject of legal, professional or other privilege. It is intended only for the named addressees and may not be disclosed to anyone else without consent from PolkaSpots Limited. If you are not the named addressee you must not use, disclose, distribute, copy, print or rely on the contents of this email and should destroy it immediately. Whilst PolkaSpots Limited takes care to protect its systems from electronic virus attack or other harmful event, the firm gives no warranty that this email message (including any attachments to it) is free of any virus or other harmful matter and accepts no responsibility for any loss or damage resulting from the recipient receiving, opening or using it. If you need any further information, please contact the originator of this message on +44 (0) 20 7183 1471. PolkaSpots Limited is registered in the UK, number 05508105. Registered Office: 204 Buspace Studios, Conlan Street, London W10 5AP Website: www.polkaspots.com --------------------------------------------------------------------------------------- -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
BTW. It does seem to work when I do: <%= c.created %> Outputs: History: Thu, 12 May 11 12:53:30 +0000 On 12 May 2011, at 13:42, Frederick Cheung wrote:> > > On May 12, 12:29 pm, simonm <si...-7ev/j6XIf0kRmelmmXo44Q@public.gmane.org> wrote: >> Hi >> >> Many thanks for the response. I''ve changed my view to this and I now >> can''t see the recent tweets but am left with the hash still. Why am I >> finding this so complicated!?! >> > > You removed the wrong equals > > Fred >> <%= @user.twitter_token.timeline.each do |t| %> >> <% t.text %> >> <br> >> <% end %> >> >> Simon >> >> On May 12, 11:55 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> >> >> >>> On May 12, 9:23 am, simonm <si...-7ev/j6XIf0kRmelmmXo44Q@public.gmane.org> wrote: >> >>>> I''m really struggling to find some information about extracting >>>> relevant information from my hash output from twitter. >> >>>> My model contains: >> >>>> def timeline >>>> @timeline = client.home_timeline >>>> end >> >>>> And my view: >> >>>> <%= @user.twitter_token.timeline.each do |t| %> >> >>> Don''t use <%= here - it will dump the result of the expression (which >>> in the case of .each is the entire collection that was iterated over) >>> into the view, which isn''t what you want >> >>> Fred >> >>>> <%= t.text %> >>>> <br> >>>> <% end %> >> >>>> I was hoping to extract just my text from the hashie but it doesn''t >>>> quite work... I get my tweets on separate lines which is great, >>>> followed by the hash again... >> >>>> [<#Hashie::Mash contributors=nil coordinates=nil created_at="Wed May >>>> 04 18:57:32 +0000 2011" favorited=false geo=nil id=65852579048980480 >>>> id_str="65852579048980480" in_reply_to_screen_name=nil >>>> in_reply_to_status_id=nil in_reply_to_status_id_str=nil >>>> in_reply_to_user_id=nil in_reply_to_user_id_str=nil place=nil >>>> retweet_count=0 retweeted=false source="web" text="what''s happening?" >>>> truncated=false user= ... >> >>>> How on earth can I stop this?! >> >>>> Thanks, >> >>>> Simon > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >--------------------------------------------------------------------------------------- The information contained in this email and its attachments is confidential and may be the subject of legal, professional or other privilege. It is intended only for the named addressees and may not be disclosed to anyone else without consent from PolkaSpots Limited. If you are not the named addressee you must not use, disclose, distribute, copy, print or rely on the contents of this email and should destroy it immediately. Whilst PolkaSpots Limited takes care to protect its systems from electronic virus attack or other harmful event, the firm gives no warranty that this email message (including any attachments to it) is free of any virus or other harmful matter and accepts no responsibility for any loss or damage resulting from the recipient receiving, opening or using it. If you need any further information, please contact the originator of this message on +44 (0) 20 7183 1471. PolkaSpots Limited is registered in the UK, number 05508105. Registered Office: 204 Buspace Studios, Conlan Street, London W10 5AP Website: www.polkaspots.com --------------------------------------------------------------------------------------- -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.