Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
/ Random-Street-View Public archive

Twitter Bot that generates a random coordinate which gets reverse geocoded, translates it to a Street View image then tweets it.

License

Notifications You must be signed in to change notification settings

shmugoh/Random-Street-View

Repository files navigation

Important Note

Random Street View is now sv-dlp. Make sure to check it out!

I will no longer be maintaining this side project unless if Twitter reverses their decision on the latest API policy change, as I do not have the enogh money to be paying for an API and I cannot migrate to other platforms. On a personal level, I don't plan on using IG/FB just for the sake of supervising the functionality of this project.

I will keep this repository up for archival purposes, so anyone is welcome to fork it/replicate it, although I would recommend implementing sv-dlp as its so much easier to rely on it rather than using a horribly-written, poorly-performed codebase (please don't look at the rewrite branch.)

Farewell Random-Street-View... for now.

Random Street View (Bot)

Twitter Bot (doesn't necessary have to be a Twitter Bot; refer to the next line) that generates a random coordinate which gets reverse geocoded, translates it to a Street View image (by getting the panorama ID via the coordinates) then tweets it.

You can also use this if you don't have intentions for a Twitter Bot as long as you credit me and remove the Twitter-related lines on the script

Before you begin...

  • You need a Google Cloud account to get access to Google Maps' API. After you get it, create a project, enable following APIs (and get the API Key via credentials):

    • Geocoding API

    • Street View Static API

  • Optional if not using it for a Twitter Bot: You also need a Twitter Developer Account; apply for access here.

  • And finally, you need Python 3; NOT 2, but 3. If you're on Windows, I recommend you to get it on Python's official website instead of downloading it on the Microsoft Store.

Setup

1. Clone the repository via git clone

git clone https://github.com/juanpisuribe13/Random-Street-View-Bot.git

2. Add your Twitter and Google API keys to the config_barebones.cfg file, then rename it to config.cfg.

3. To not clutter your Python installation, create a virtual environment by typing this line:

python3 -m venv env

# if above command opens windows store, try this one
python -m venv env

3.1 After creating the virtual environment, access it by:

# For UNIX users:
source env/bin/activate

# For Windows users:
.\env\Scripts\activate.bat

4. Install the required libraries found in the requirements.txt file.

pip install -r requirements.txt

# if above command doesn't work, try this
python3 -m pip install -r requirements.txt

## if above command STILL doesn't work because it 
## opened a windows store tab, try this one
python3 -m pip install -r requirements.txt

5. You're done! All you have to do is run python3 main.py (or python main.py if it opens Windows Store)

FAQ

Are the images panoramic/360?

Short Answer: No.

Long Answer: Still no. Google Maps API hasn't implemented that yet and only way to get it is via "undocumented interfaces" which is against Google's TOS. So if you end up implementing it and Google bans you, that's your problem.

Why are the images low-res?

That's Google's problem. Even if you give it the highest resolution, the quality of the image is still low-res.

What APIs does this script use?

  • Geocoding API (Reverse Geocode)

  • Street View Static API (SV Image Metadata to get the Panorama ID and SV Static API to download the Street View Image)

I want to use this, but I don't plan doing it as a Twitter Bot. Can I?

Sure! As long as you credit me; if you have knowledge of Python (which you should), you could easily remove the Twitter-related lines. Also refer to the next question

Can I use this for my project/twitter bot?

Sure! As long as you link the source code of this (or credit me if you fork this repository and edit your own code). Keep in mind though I won't be responsible if the billing comes expensive; refer to the start of this README.md for more information.

If Google Maps' API is pricey, why are you using it?

I'm using it because it's the easiest way to reverse geocoordinates that are compatible with Street View, and it's the only way to get panoramic IDs.

Contributing

If you see that the code's messy, something doesn't work, or I left something dumb there accidentally then feel free to send a pull request and I'll review it!

License

MIT

About

Twitter Bot that generates a random coordinate which gets reverse geocoded, translates it to a Street View image then tweets it.

Topics

Resources

License

Stars

Watchers

Forks

Languages