Skip to content

Instantly share code, notes, and snippets.

@hakobe
Created December 10, 2009 16:09
Show Gist options
  • Select an option

  • Save hakobe/253418 to your computer and use it in GitHub Desktop.

Select an option

Save hakobe/253418 to your computer and use it in GitHub Desktop.
diff --git a/examples/tig.rb b/examples/tig.rb
index 7539609..2d597f5 100755
--- a/examples/tig.rb
+++ b/examples/tig.rb
@@ -1736,7 +1736,8 @@ class TwitterIrcGateway < Net::IRC::Server::Session
r = []
cursor = -1
1.upto(limit) do |num|
- ret = api(path, { :cursor => cursor }, { :authenticate => authenticate })
+ # next_cursor にアクセスするとNot found が返ってくることがあるので,その時はbreak
+ ret = api(path, { :cursor => cursor }, { :authenticate => authenticate }) rescue break
arr = ret[name.to_s]
r.concat arr
cursor = ret[:next_cursor]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment