digininja / twofi

Twitter Words of Interest - Generate word lists from twitter searches
30 stars 3 forks source link

Using the term search fucntion fails #2

Open deathbychocolate opened 3 years ago

deathbychocolate commented 3 years ago

When using the -t flag to search for terms, we get an error 'connection reset by peer error'. The output below is produced by the following command: sudo twofi -c -t obama

┌──(kali㉿kali)-[~/Documents]
└─$ sudo twofi -c -t obama      
Traceback (most recent call last):
        22: from /usr/bin/twofi:195:in `<main>'
        21: from /usr/bin/twofi:195:in `each'
        20: from /usr/bin/twofi:197:in `block in <main>'
        19: from /usr/bin/twofi:197:in `to_a'
        18: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        17: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        16: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        15: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        14: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        13: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        12: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        11: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        10: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
         9: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:14:in `each'
         8: from /usr/lib/ruby/vendor_ruby/twitter/search_results.rb:52:in `fetch_next_page'
         7: from /usr/lib/ruby/vendor_ruby/twitter/rest/request.rb:39:in `perform'
         6: from /usr/lib/ruby/2.7.0/forwardable.rb:229:in `empty?'
         5: from /usr/lib/ruby/vendor_ruby/http/response/body.rb:51:in `to_s'
         4: from /usr/lib/ruby/vendor_ruby/http/connection.rb:92:in `readpartial'
         3: from /usr/lib/ruby/vendor_ruby/http/connection.rb:212:in `read_more'
         2: from /usr/lib/ruby/vendor_ruby/http/timeout/null.rb:45:in `readpartial'
         1: from /usr/lib/ruby/2.7.0/openssl/buffering.rb:125:in `readpartial'
/usr/lib/ruby/2.7.0/openssl/buffering.rb:125:in `sysread': Connection reset by peer (Errno::ECONNRESET)
        22: from /usr/bin/twofi:195:in `<main>'
        21: from /usr/bin/twofi:195:in `each'
        20: from /usr/bin/twofi:197:in `block in <main>'
        19: from /usr/bin/twofi:197:in `to_a'
        18: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        17: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        16: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        15: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        14: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        13: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        12: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        11: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
        10: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in `each'
         9: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:14:in `each'
         8: from /usr/lib/ruby/vendor_ruby/twitter/search_results.rb:52:in `fetch_next_page'
         7: from /usr/lib/ruby/vendor_ruby/twitter/rest/request.rb:39:in `perform'
         6: from /usr/lib/ruby/2.7.0/forwardable.rb:229:in `empty?'
         5: from /usr/lib/ruby/vendor_ruby/http/response/body.rb:51:in `to_s'
         4: from /usr/lib/ruby/vendor_ruby/http/connection.rb:92:in `readpartial'
         3: from /usr/lib/ruby/vendor_ruby/http/connection.rb:212:in `read_more'
         2: from /usr/lib/ruby/vendor_ruby/http/timeout/null.rb:45:in `readpartial'
         1: from /usr/lib/ruby/2.7.0/openssl/buffering.rb:125:in `readpartial'
/usr/lib/ruby/2.7.0/openssl/buffering.rb:125:in `sysread': error reading from socket: Connection reset by peer (HTTP::ConnectionError)

┌──(kali㉿kali)-[~/Documents]
└─$    

This error is reproducable iwth slight variations, but ALL have a 'Connection reset by peer' error.

digininja commented 3 years ago

I've not touched this tool in years so I wouldn't be surprised if Twitter have changed their API and it's completely broken.

I'll have a look and see what I can find.

On Tue, 25 May 2021, 19:41 Damian, @.***> wrote:

When using the -t flag to search for terms, we get an error 'connection reset by peer error'. The output below is produced by the following command: sudo twofi -c -t obama

┌──(kali㉿kali)-[~/Documents] └─$ sudo twofi -c -t obama Traceback (most recent call last): 22: from /usr/bin/twofi:195:in

' 21: from /usr/bin/twofi:195:in each' 20: from /usr/bin/twofi:197:in block in
' 19: from /usr/bin/twofi:197:in to_a' 18: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 17: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 16: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 15: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 14: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 13: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 12: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 11: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 10: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 9: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:14:in each' 8: from /usr/lib/ruby/vendor_ruby/twitter/search_results.rb:52:in fetch_next_page' 7: from /usr/lib/ruby/vendor_ruby/twitter/rest/request.rb:39:in perform' 6: from /usr/lib/ruby/2.7.0/forwardable.rb:229:in empty?' 5: from /usr/lib/ruby/vendor_ruby/http/response/body.rb:51:in to_s' 4: from /usr/lib/ruby/vendor_ruby/http/connection.rb:92:in readpartial' 3: from /usr/lib/ruby/vendor_ruby/http/connection.rb:212:in read_more' 2: from /usr/lib/ruby/vendor_ruby/http/timeout/null.rb:45:in readpartial' 1: from /usr/lib/ruby/2.7.0/openssl/buffering.rb:125:in readpartial' /usr/lib/ruby/2.7.0/openssl/buffering.rb:125:in sysread': Connection reset by peer (Errno::ECONNRESET) 22: from /usr/bin/twofi:195:in ' 21: from /usr/bin/twofi:195:in each' 20: from /usr/bin/twofi:197:in block in ' 19: from /usr/bin/twofi:197:in to_a' 18: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 17: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 16: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 15: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 14: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 13: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 12: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 11: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 10: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:15:in each' 9: from /usr/lib/ruby/vendor_ruby/twitter/enumerable.rb:14:in each' 8: from /usr/lib/ruby/vendor_ruby/twitter/search_results.rb:52:in fetch_next_page' 7: from /usr/lib/ruby/vendor_ruby/twitter/rest/request.rb:39:in perform' 6: from /usr/lib/ruby/2.7.0/forwardable.rb:229:in empty?' 5: from /usr/lib/ruby/vendor_ruby/http/response/body.rb:51:in to_s' 4: from /usr/lib/ruby/vendor_ruby/http/connection.rb:92:in readpartial' 3: from /usr/lib/ruby/vendor_ruby/http/connection.rb:212:in read_more' 2: from /usr/lib/ruby/vendor_ruby/http/timeout/null.rb:45:in readpartial' 1: from /usr/lib/ruby/2.7.0/openssl/buffering.rb:125:in readpartial' /usr/lib/ruby/2.7.0/openssl/buffering.rb:125:in sysread': error reading from socket: Connection reset by peer (HTTP::ConnectionError)

┌──(kali㉿kali)-[~/Documents] └─$

This error is reproducable iwth slight variations, but ALL have a 'Connection reset by peer' error.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/digininja/twofi/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA4SWLQJ3UND6LNYPUEVJDTPPVOFANCNFSM45P64WJA .

digininja commented 3 years ago

I've just checked and it is still working as expected. Looking at the error and the way you are calling the app, it looks like you are using an old version and not the latest from here. Line 197 isn't a to_a in the current version.

Try the latest version from here and see if that does what you want. Beware it will be slow, I'm not sure why, but on a big term one of the functions is taking a very long time to return.

digininja commented 3 years ago

Update, it worked for some uncommon search terms, but on obama it just died with a twitter rate limit error.

So still looks like you are running a buggy version, but even if you update you'll not get your obama results.