twintproject / twint

An advanced Twitter scraping & OSINT tool written in Python that doesn't use Twitter's API, allowing you to scrape a user's followers, following, Tweets and more while evading most API limitations.
MIT License
15.75k stars 2.72k forks source link

IP Address #681

Closed meganjo88 closed 4 years ago

meganjo88 commented 4 years ago

Hi,

I am new to Github and to coding. It took me days to figure out Twint and I finally did. I can use basic scripts to find information but I am trying to find a users location. I have been reading the issues and found a location script issue a while back and so I tried it and this is what I inputted:

import twint

c = twint.Config() c.Username = "The users @ name"

c.location = True

c.store_csv = True c.output = Location.csv

twint.run.search(c)

When doing this, the first error from import twint was "syntax error near unexpected token C, then command not found.

Then I just entered "import twint" and that gave me "import -im6.q16: not authorized 'twint' @ error / constitute

What am I doing wrong? Is it possible to find a users location or IP address or to see what city they are in?

pielco11 commented 4 years ago

It seems that you can't import the library, so an issue on your end and not with twint

How did you install twint? Does the user have the rights to access the corresponding directory?

meganjo88 commented 4 years ago

I downloaded VirtualBox and Ubuntu and set up an VM machine to run it. Then I did the following: cd Downloads mkdir Programs cd Programs sudo apt install git git clone https://github.com/twintproject/twint.git cd twint sudo python3 setup.py install then I went to download the requirements.txt and I can look up the simple scripts like -u, -s etc. I just cant do the more complicated scripts like import twint.

Does this help?

pielco11 commented 4 years ago

May you run pip3 install --user twint?

You ran pip as sudo, which means that the twint library was installed in the home directory of root. Running twint as root is not need and not really suggested.

Please re-try and let me know

meganjo88 commented 4 years ago

I ran the pip3 install --user twint and it installed and then I tried the import twint and it gave the same error. Should I uninstall everything and restart?

pielco11 commented 4 years ago

Ok maybe there are conflicts because you installed twint in that local directory, thus python import that first.

You should remove that local installation by removing the directory, for example

meganjo88 commented 4 years ago

Okay so there is no way to remove that in Ubuntu. I have tried multiple ways. I ended up rebuilding VirtualBox with another Ubuntu download and I cannot remove root or sudo and cant install python, twint, or git without sudo.

Any advice?

pielco11 commented 4 years ago

Afaik, you have to install python and git with sudo, and you can install packages for the specific user

  1. setup the VM
  2. install python and git with sudo
  3. pip3 install --user twint
meganjo88 commented 4 years ago

Thank you! It finally worked

pielco11 commented 4 years ago

Great to know, another final note about running or not python scripts as root

So you can be sure that Twint does not contain malicious stuff that could harm you or your environment, but we don't have control over the libraries that we use. Actually, we could use forked ones and review the code, but that's not how life works. That said, if someone hijacks the libraries that we use and place some malicious code, running it as sudo could be really dangerous.

Please take care