Skip to content
This repository has been archived by the owner on Jul 19, 2020. It is now read-only.

twitter_user.rb error #13

Closed
ghost opened this issue Jun 24, 2014 · 3 comments
Closed

twitter_user.rb error #13

ghost opened this issue Jun 24, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Jun 24, 2014

I tried to use the twitter_user.rb file but I receive this error. Is something not right?

scheduler caught exception:
undefined method attributes' for nil:NilClass /home/pi/manch/jobs/twitter_user.rb:14:inblock in <top (required)>'
/home/pi/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:230:in call' /home/pi/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:230:intrigger_block'
/home/pi/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:204:in block in trigger' /home/pi/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/scheduler.rb:430:incall'
/home/pi/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/scheduler.rb:430:in `block in trigger_job'

@mplewis
Copy link

mplewis commented Jul 16, 2014

I'm seeing the same issue.

@mplewis
Copy link

mplewis commented Jul 16, 2014

It looks like the issue is caused by Twitter changing their site layout. Replace lines 13 through 15 in twitter_user.rb with the following:

  tweets = doc.css('a[data-nav=tweets]').first.attributes['title'].value.split(' ').first
  followers = doc.css('a[data-nav=followers]').first.attributes['title'].value.split(' ').first
  following = doc.css('a[data-nav=following]').first.attributes['title'].value.split(' ').first

@Ephigenia
Copy link
Owner

@mplewis thanks for the hint, i hope that works fine. Twitter and the other services might change their markup from time to time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants