All Projects → doersino → earthacrosstime

doersino / earthacrosstime

Licence: MIT license
Twitter bot that posts videos showcasing how random locations in the world have changed since 1984.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to earthacrosstime

google-maps-at-88-mph
Google Maps keeps old satellite imagery around for a while – this tool collects what's available for a user-specified region in the form of a GIF.
Stars: ✭ 93 (+232.14%)
Mutual labels:  aerial-imagery, satellite-imagery, timelapse
Aerialbot
A simple yet highly configurable bot that tweets geotagged aerial imagery of a random location in the world.
Stars: ✭ 157 (+460.71%)
Mutual labels:  shapefile, satellite-imagery
Robosat
Semantic segmentation on aerial and satellite imagery. Extracts features such as: buildings, parking lots, roads, water, clouds
Stars: ✭ 1,789 (+6289.29%)
Mutual labels:  aerial-imagery, satellite-imagery
gis-snippets
Some code snippets for GIS tasks
Stars: ✭ 45 (+60.71%)
Mutual labels:  shapefile
hug-bot
A twitter bot that gives out free hugs.
Stars: ✭ 22 (-21.43%)
Mutual labels:  twitter-bot
eemont
A python package that extends Google Earth Engine.
Stars: ✭ 290 (+935.71%)
Mutual labels:  satellite-imagery
lightweight-temporal-attention-pytorch
A PyTorch implementation of the Light Temporal Attention Encoder (L-TAE) for satellite image time series. classification
Stars: ✭ 43 (+53.57%)
Mutual labels:  satellite-imagery
Twitter Activated Crypto Trading Bot
Buys crypto through keyword detection in new tweets. Executes buy in 1 second and holds for a given time (e.g. Elon tweets 'doge', buys Dogecoin and sells after 5 minutes). Tested on Kraken and Binance exchanges
Stars: ✭ 92 (+228.57%)
Mutual labels:  twitter-bot
BingMapsSDSToolkit
This toolkit makes it easy to use the Bing Maps Spatial Data Services (SDS) in .NET
Stars: ✭ 39 (+39.29%)
Mutual labels:  shapefile
indi-allsky
Software to manage a Linux-based All Sky Camera.
Stars: ✭ 59 (+110.71%)
Mutual labels:  timelapse
goes2go
Download and process GOES-16 and GOES-17 data from NOAA's archive on AWS using Python.
Stars: ✭ 77 (+175%)
Mutual labels:  satellite-imagery
xarray-sentinel
Xarray backend to Copernicus Sentinel-1 satellite data products
Stars: ✭ 189 (+575%)
Mutual labels:  satellite-imagery
twitter-like-bot
This app allows you to automate Twitter liking for specific keywords, hashtags, or even full sentences. The bot uses streaming API which means that everything happens in real time.
Stars: ✭ 30 (+7.14%)
Mutual labels:  twitter-bot
pyGISS
📡 A lightweight GIS Software in less than 100 lines of code
Stars: ✭ 114 (+307.14%)
Mutual labels:  shapefile
twitter-bot-playground
Want to build your own twitter bot 🐣 check out the documentation.
Stars: ✭ 60 (+114.29%)
Mutual labels:  twitter-bot
deck.gl-raster
deck.gl layers and WebGL modules for client-side satellite imagery analysis
Stars: ✭ 60 (+114.29%)
Mutual labels:  satellite-imagery
LGBTQ-of-the-day-bot
Twitter bot tweeting fun goofy lgbtq things and queer history of the day
Stars: ✭ 65 (+132.14%)
Mutual labels:  twitter-bot
TeleTweet
🦉 A telegram Twitter bot that will allow you send tweets!
Stars: ✭ 34 (+21.43%)
Mutual labels:  twitter-bot
sentinel-util
A CLI for downloading, processing, and making a mosaic from Sentinel-1, -2 and -3 data
Stars: ✭ 22 (-21.43%)
Mutual labels:  satellite-imagery
GoogleEarthEngine-side-projects
Google Earth Engine side projects and tutorial scripts
Stars: ✭ 23 (-17.86%)
Mutual labels:  satellite-imagery

earthacrosstime

Twitter bot that posts videos showcasing how random locations in the world have changed since 1984.

In a bit more detail, whenever the bot runs, it...

  • loads a shapefile from disk,
  • generates a random point within the bounds of this shape,
  • figures out which video tile needs to be downloaded to the point and an area around it,
  • downloads that video from the repository underlying Google Earth Timelapse,
  • reverse geocodes the chosen point using Nominatim to figure out the location's name,
  • edits the video, annotating it with latitude & longitude, area covered, and a named pin on a world map,
  • saves that to disk,
  • and tweets the edited video, optionally with a geotag.

Much of the code has been adapted from ærialbot, a previous project of mine that basically does the same (and more!) for static maps, and CMU's Time Machine Viewer, which contains reference implementations of the required coordinate projections.

🐦 Check it out at @earthacrosstime!

Here's one of the videos tweeted by this bot, showing the construction of Incheon Airport and various developments on land.

earthacrosstime-example-incheon-airport-construction.mp4

Features

Here's why this bot is a Good Bot:

  • Configurability: Take a look at config.sample.ini – you can supply your own shapefile (or instead define a fixed point), control output verbosity, set a different Time Machine repository, scale the result videos to your preferred size, define the text of the tweet, and more!
  • Correctness: Because neighboring meridians are closer at the poles than at the equator, uniformly sampling the allowable range of latitudes would bias the generated random points toward the poles. Instead, this bot makes sure they are distributed with regard to surface area.
  • Automatic zoom level selection: Simply supply a maximum allowable number of meters per pixel – the code will then take care of dialing in a (more than) sufficient zoom level.
  • Comes with batteries included: The assets/world-shapefile/ directory contains a shapefile providing the outlines of the continents and most islands. More shapefiles, along with a guide on how to convert third-party shapefiles to the correct format, can be found here.
  • Cares about typography: The text that's superimposed onto the result videos is aligned with utmost precision. Just in case you were wondering.
  • Geotagging: Tweets will be geotagged with the exact location – you can disable this, of course.
  • Logging: Keeps a log file – whether that's for debugging or reminiscing is your call. Again, you can disable this easily.

Usage

Setup

Being a good Python 3 citizen, this program integrates with venv or similar packages to avoid dependency hell. Run the following commands to get it installed on your system:

$ git clone https://github.com/doersino/earthacrosstime
$ python3 -m venv earthacrosstime
$ cd earthacrosstime
$ source bin/activate
$ pip3 install -r requirements.txt

(To deactivate the virtual environment, run deactivate.)

One of the dependencies, Shapely, requires the GEOS library for performing operations on two-dimensional vector geometries, which you may need to install first as described here.

Configuration

Copy config.sample.ini to config.ini, open it and modify it based on the (admittedly wordy) instructions in the comments.

See here for advice regarding finding shapefiles of the region you're interested in and preparing them for use with ærialbot.

Running

Once you've set everything up and configured it to your liking, navigate to the directory where earthacrosstime.py is located (this is important – the bot won't be able to find some required assets otherwise) and run it:

$ python3 earthacrosstime.py

That's basically it!

If you want your bot to tweet at predefined intervals, use cron, runwhen or a similar tool. To make cron work with venv, you'll need to use bash and execute the activate script before running the bot (in this example, it runs every eight hours at 50 past the hour):

50 */8 * * * /usr/bin/env bash -c 'cd /PATH/TO/earthacrosstime && source bin/activate && python3 earthacrosstime.py'

Pro tip: If you want to host multiple instances of this bot, you don't need multiple copies of the code – multiple config files suffice: simply run python3 earthacrosstime.py one-of-your-config-files.ini.

Uber pro tip: Run python3 earthacrosstime.py --help to learn about some secret CLI options!

License

You may use this repository's contents under the terms of the MIT License, see LICENSE.

However, the subdirectory assets/ contains some third-party software and data with their own licenses:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].