Skip to content

undefined method 'permalink=' error #1

Open
sjoonk opened this Issue Sep 2, 2010 · 1 comment

2 participants

@sjoonk
sjoonk commented Sep 2, 2010

When i use this gem in my irb, an error occurred. dump is below:

Topsy.trackbacks('http://bit.ly/bXlhni', :perpage => 50)
NoMethodError: undefined method permalink=' for <#Topsy::Tweet>:Topsy::Tweet
from /Library/Ruby/Gems/1.8/gems/hashie-0.4.0/lib/hashie/dash.rb:81:in
send'
from /Library/Ruby/Gems/1.8/gems/hashie-0.4.0/lib/hashie/dash.rb:81:in initialize'
from /Library/Ruby/Gems/1.8/gems/hashie-0.4.0/lib/hashie/dash.rb:80:in
each_pair'
from /Library/Ruby/Gems/1.8/gems/hashie-0.4.0/lib/hashie/dash.rb:80:in initialize'
from /Library/Ruby/Gems/1.8/gems/topsy-0.3.1/lib/topsy/page.rb:39:in
new'
from /Library/Ruby/Gems/1.8/gems/topsy-0.3.1/lib/topsy/page.rb:39:in list='
from /Library/Ruby/Gems/1.8/gems/topsy-0.3.1/lib/topsy/page.rb:39:in
each'
from /Library/Ruby/Gems/1.8/gems/topsy-0.3.1/lib/topsy/page.rb:39:in list='
from /Library/Ruby/Gems/1.8/gems/hashie-0.4.0/lib/hashie/dash.rb:81:in
send'
from /Library/Ruby/Gems/1.8/gems/hashie-0.4.0/lib/hashie/dash.rb:81:in initialize'
from /Library/Ruby/Gems/1.8/gems/hashie-0.4.0/lib/hashie/dash.rb:80:in
each_pair'
from /Library/Ruby/Gems/1.8/gems/hashie-0.4.0/lib/hashie/dash.rb:80:in initialize'
from /Library/Ruby/Gems/1.8/gems/topsy-0.3.1/lib/topsy/page.rb:33:in
initialize'
from /Library/Ruby/Gems/1.8/gems/topsy-0.3.1/lib/topsy/client.rb:156:in new'
from /Library/Ruby/Gems/1.8/gems/topsy-0.3.1/lib/topsy/client.rb:156:in
trackbacks'
from /Library/Ruby/Gems/1.8/gems/topsy-0.3.1/lib/topsy.rb:148:in `trackbacks'
from (irb):2>> exit

@etagwerker
Collaborator

This seems to be an issue with the Otter API.

This is the output I get after using CURL:

[etagwerker@gesell ~]$ curl -i "http://otter.topsy.com/trackbacks.json?url=http://bit.ly/bXlhni"
HTTP/1.1 200 OK
Cache-Control: max-age=5
Content-Type: application/json; charset=utf-8
Expires: Thu, 02 Sep 2010 13:44:37 GMT
Last-Modified: Thu, 02 Sep 2010 13:44:32 GMT
Server: lighttpd/1.4.26
Content-Length: 6136
Date: Thu, 02 Sep 2010 13:44:32 GMT
X-Varnish: 1954081562
Age: 0
Via: 1.1 varnish
X-Served-By: ps160
X-Cache: MISS
X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9986
X-RateLimit-Reset: 1283438347
Connection: close

{"request":{"parameters":{"orig_url":"http://bit.ly/bXlhni","redirected_url":"http://plusevent.enclean.com/pre/event1.do","url":"http://plusevent.enclean.com/pre/event1.do"},"response_type":"json","resource":"trackbacks","url":"http://otter.topsy.com/trackbacks.json?orig_url=http%3A%2F%2Fbit.ly%2FbXlhni&redirected_url=http%3A%2F%2Fplusevent.enclean.com%2Fpre%2Fevent1.do&url=http%3A%2F%2Fplusevent.enclean.com%2Fpre%2Fevent1.do"},"response":{"last_offset":10,"page":1,"topsy_trackback_url":"http://topsy.com/bit.ly/bXlhni","hidden":0,"total":35,"offset":0,"perpage":10,"list":[{"permalink_url":"http://twitter.com/4bu4bu/status/22323532731","date":1282966525,"content":"RT @sdlee89: 오널리알려주세요 왕대박 RT @hollsee: 만원어치 공짜로 기름넣는 쉬운방법!! http://bit.ly/bXlhni SK엔크린 이벤트~","date_alpha":"5 days ago","author":{"name":"샤르르샤브샤브 마포점","url":"http://twitter.com/4bu4bu","nick":"4bu4bu","topsy_author_url":"http://topsy.com/twitter/4bu4bu?utm_source=otter","photo_url":"http://a0.twimg.com/profile_images/1097507668/2611928293_1_normal.jpg"},"type":"tweet"},{"permalink_url":"http://twitter.com/sdlee89/status/22156620787","date":1282804868,"content":"RT @hollsee: #경품당_ 차 있으신분 1만원 주유권 받을 수 있는 기회 http://bit.ly/bXlhni 1만원 주유권을 천명준답니다. 당첨 확률도 제법 높네요","date_alpha":"7 days ago","author":{"name":"이상동","url":"http://twitter.com/sdlee89","nick":"sdlee89","topsy_author_url":"http://topsy.com/twitter/sdlee89?utm_source=otter","photo_url":"http://a0.twimg.com/profile_images/1090271584/___normal.jpg"},"type":"tweet"},{"permalink_url":"http://twitter.com/hollsee/status/22151850733","date":1282798974,"content":"#경품당_ 차 있으신분 1만원 주유권 받을 수 있는 기회 http://bit.ly/bXlhni 1만원 주유권을 천명준답니다. 당첨 확률도 제법 높네요","date_alpha":"7 days ago","author":{"name":"jiayou","url":"http://twitter.com/hollsee","nick":"hollsee","topsy_author_url":"http://topsy.com/twitter/hollsee?utm_source=otter","photo_url":"http://a1.twimg.com/profile_images/1107617017/kdlakd_normal.jpg"},"type":"tweet","permalink":{"topsy_trackback_url":"http://topsy.com/plusevent.enclean.com/pre/event1.do?utm_source=otter","trackback_total":1}},{"permalink_url":"http://twitter.com/hollsee/status/21977568968","date":1282628841,"content":"RT @Event_King: 차 있으신분 1만원 주유권 받을 수 있는 기회 http://bit.ly/bXlhni 1만원 주유권을 천명준답니다. 당첨 확률도 제법 높네요","date_alpha":"9 days ago","author":{"name":"jiayou","url":"http://twitter.com/hollsee","nick":"hollsee","topsy_author_url":"http://topsy.com/twitter/hollsee?utm_source=otter","photo_url":"http://a1.twimg.com/profile_images/1107617017/kdlakd_normal.jpg"},"type":"tweet"},{"permalink_url":"http://twitter.com/sdlee89/status/21971735531","date":1282622366,"content":"RT @hollsee: [이벤트]SK엔크린개편! 이벤트응모하시고 공짜기름도 받아가세요! 자세한내용은 http://bit.ly/bXlhni RT부탁드려요~ #eventdang","date_alpha":"9 days ago","author":{"name":"이상동","url":"http://twitter.com/sdlee89","nick":"sdlee89","topsy_author_url":"http://topsy.com/twitter/sdlee89?utm_source=otter","photo_url":"http://a0.twimg.com/profile_images/1090271584/___normal.jpg"},"type":"tweet"},{"permalink_url":"http://twitter.com/hk_holmes/status/21966589139","date":1282617947,"content":"RT @bravadoK: 공짜기름이벤트네요 ㅎㅎ RT @hollsee 만원어치 공짜로 기름넣는 법이 있네요 와우~~ http://bit.ly/bXlhni","date_alpha":"9 days ago","author":{"name":"hyekyoung","url":"http://twitter.com/hk_holmes","nick":"hk_holmes","topsy_author_url":"http://topsy.com/twitter/hk_holmes?utm_source=otter","photo_url":"http://a3.twimg.com/profile_images/1107541043/0_normal.jpg"},"type":"tweet"},{"permalink_url":"http://twitter.com/bimokjiae/status/21949886651","date":1282603845,"content":"개편을 축하합니다 RT @hollsee [이벤트]SK엔크린개편! 이벤트응모하시고 공짜기름도 받아가세요! 자세한내용은 http://bit.ly/bXlhni RT부탁드려요~ #eventdang","date_alpha":"10 days ago","author":{"name":"Chang wook Lee","url":"http://twitter.com/bimokjiae","nick":"bimokjiae","topsy_author_url":"http://topsy.com/twitter/bimokjiae?utm_source=otter","photo_url":"http://a3.twimg.com/profile_images/1096535315/__100727_010_normal.jpg"},"type":"tweet"},{"permalink_url":"http://twitter.com/whiteym777/status/21949231304","date":1282603252,"content":"RT @hollsee [이벤트]SK엔크린개편! 이벤트응모하시고 공짜기름도 받아가세요! 자세한내용은 http://bit.ly/bXlhni RT부탁드려요~ #eventdang","date_alpha":"10 days ago","author":{"name":"최영민","url":"http://twitter.com/whiteym777","nick":"whiteym777","topsy_author_url":"http://topsy.com/twitter/whiteym777?utm_source=otter","photo_url":"http://a2.twimg.com/profile_images/1037074946/white_normal.jpg"},"type":"tweet"},{"permalink_url":"http://twitter.com/meegr/status/21933502263","date":1282587926,"content":"RT @fullmoa RT @hollsee [이벤트]SK엔크린개편! 이벤트응모하시고 공짜기름도 받아가세요! 자세한내용은 http://bit.ly/bXlhni RT부탁드려요~ #eventdang","date_alpha":"10 days ago","author":{"name":"崔 微","url":"http://twitter.com/meegr","nick":"meegr","topsy_author_url":"http://topsy.com/twitter/meegr?utm_source=otter","photo_url":"http://a2.twimg.com/profile_images/924877430/meegr_normal.jpg"},"type":"tweet"},{"permalink_url":"http://twitter.com/meegr/status/21933489403","date":1282587912,"content":"RT @fullmoa: RT @hollsee [이벤트]SK엔크린개편! 이벤트응모하시고 공짜기름도 받아가세요! 자세한내용은 http://bit.ly/bXlhni RT부탁드려요~ #eventdang","date_alpha":"10 days ago","author":{"name":"崔 微","url":"http://twitter.com/meegr","nick":"meegr","topsy_author_url":"http://topsy.com/twitter/meegr?utm_source=otter","photo_url":"http://a2.twimg.com/profile_images/924877430/meegr_normal.jpg"},"type":"tweet"}]}}

As you can see, this chunk of the response isn't as specified in the spec:

{"permalink_url":"http://twitter.com/hollsee/status/22151850733","date":1282798974,"content":"#경품당_ 차 있으신분 1만원 주유권 받을 수 있는 기회 http://bit.ly/bXlhni 1만원 주유권을 천명준답니다. 당첨 확률도 제법 높네요","date_alpha":"7 days ago","author":{"name":"jiayou","url":"http://twitter.com/hollsee","nick":"hollsee","topsy_author_url":"http://topsy.com/twitter/hollsee?utm_source=otter","photo_url":"http://a1.twimg.com/profile_images/1107617017/kdlakd_normal.jpg"},"type":"tweet","permalink":{"topsy_trackback_url":"http://topsy.com/plusevent.enclean.com/pre/event1.do?utm_source=otter","trackback_total":1}},

I'll post this to the Otter group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.