A bot that tweets info and location map for new bicycle parking added to OpenStreetMap within a GeoJSON boundary.

Overview

Bike parking tweepy bot app

A twitter bot app that searches for bicycle parking added to OpenStreetMap. Relies on AWS Lambda/S3, Python3, Tweepy, Flask, Zappa, and a boundary GeoJSON file.

What you need

  • AWS-CLI, Python3, pip, (pipenv is optional, but recommended)
  • Geoapify Static Maps API key
  • Twitter Developer API keys and access tokens for your bot account
  • Working knowledge of python, AWS S3, OpenStreetMap (and its Overpass API)

Setup

  • Git clone the repo to your local system (git clone https://github.com/trivisonno/bikeparking-tweepy.git)
  • Install all python dependencies using pip (pip install zappa flask shapely overpass boto3 tinydb)
  • Create a zappa project with defaults (zappa init)
  • Rename the secrets.sample.py file to secrets.py, and add your Geoapify and Twitter API keys and access tokens
  • Update line 15 of the app.py with the node ID from which you wish to start tracking new bike parking items. If you set it to 0, then the app will tweet out info for every single bicycle parking item it finds. You might wish to only tweet about bicycle parking added after your launched your app, so you should update this with an appropriate nodeId. If you leave the default value (9256651107), that should only add anything after about November 17, 2021. (TODO: Update this setting code.)
  • If you wish, adjust the radius (meters) on line 16 for the nearby POI search. (Default: 50)
  • Create an S3 bucket, and update line 19 of the app.py file with the bucket name
  • Line 33 includes the allowed bicycle parking types in an array. You can add types to this list if you want to be more flexible in reporting. (Default: ['stands', 'bollard', 'lockers']) (See other types)
  • Modify line 36 to include other types of nearby POIs. (Default seems to be a good balance)
  • Replace the boundary.geojson file with your own desired boundary file. The default is Cleveland, Ohio. The app will use this boundary to filter the bicycle parking items.
  • Update the zappa_settings.json and add lines 9-18 of the zappa_settings.sample.json file. The app is scheduled to check the OpenStreeetMap at the top of every hour from 9-6 EST.
  • Launch to AWS Lambda with zappa (zappa deploy dev)

Authors

Angelo @Trivisonno (not a professional app developer, so forgive all oversights)

License

This project is licensed under the Unlicense (Public Domain)- see the LICENSE file for details

You might also like...
A library to access OpenStreetMap related services
A library to access OpenStreetMap related services

OSMPythonTools The python package OSMPythonTools provides easy access to OpenStreetMap (OSM) related services, among them an Overpass endpoint, Nomina

Using Global fishing watch's data to build a machine learning model that can identify illegal fishing and poaching activities through satellite and geo-location data.
Using Global fishing watch's data to build a machine learning model that can identify illegal fishing and poaching activities through satellite and geo-location data.

Using Global fishing watch's data to build a machine learning model that can identify illegal fishing and poaching activities through satellite and geo-location data.

A simple python script that, given a location and a date, uses the Nasa Earth API to show a photo taken by the Landsat 8 satellite. The script must be executed on the command-line.
A simple python script that, given a location and a date, uses the Nasa Earth API to show a photo taken by the Landsat 8 satellite. The script must be executed on the command-line.

What does it do? Given a location and a date, it uses the Nasa Earth API to show a photo taken by the Landsat 8 satellite. The script must be executed

This is a simple python code to get IP address and its location using python

IP address & Location finder @DEV/ED : Pavan Ananth Sharma Dependencies: ip2geotools Note: use pip install ip2geotools to install this in your termin

A service to auto provision devices in Aruba Central based on the Geo-IP location
A service to auto provision devices in Aruba Central based on the Geo-IP location

Location Based Provisioning Service for Aruba Central A service to auto provision devices in Aruba Central based on the Geo-IP location Geo-IP auto pr

LicenseLocation - License Location With Python
LicenseLocation - License Location With Python

LicenseLocation Hi,everyone! ❤ 🧡 💛 💚 💙 💜 This is my first project! ✔ Actual

Mmdb-server - An open source fast API server to lookup IP addresses for their geographic location

mmdb-server mmdb-server is an open source fast API server to lookup IP addresses

Zora is a python program that searches for GeoLocation info for given CIDR networks , with options to search with API or without API
Zora is a python program that searches for GeoLocation info for given CIDR networks , with options to search with API or without API

Zora Zora is a python program that searches for GeoLocation info for given CIDR networks , with options to search with API or without API Installing a

Get-countries-info - A python code that fetches data of any country

Country-info A python code getting countries information including country's map

Owner
Angelo Trivisonno
Angelo Trivisonno
Calculate the area inside of any GeoJSON geometry. This is a port of Mapbox's geojson-area for Python

geojson-area Calculate the area inside of any GeoJSON geometry. This is a port of Mapbox's geojson-area for Python. Installation $ pip install area U

Alireza 87 Dec 14, 2022
Location field and widget for Django. It supports Google Maps, OpenStreetMap and Mapbox

django-location-field Let users pick locations using a map widget and store its latitude and longitude. Stable version: django-location-field==2.1.0 D

Caio Ariede 481 Dec 29, 2022
Python renderer for OpenStreetMap with custom icons intended to display as many map features as possible

Map Machine project consists of Python OpenStreetMap renderer: SVG map generation, SVG and PNG tile generation, Röntgen icon set: unique CC-BY 4.0 map

Sergey Vartanov 0 Dec 18, 2022
Replace MSFS2020's bing map to google map

English verison here 中文 免责声明 本教程提到的方法仅用于研究和学习用途。我不对使用、拓展该教程及方法所造成的任何法律责任和损失负责。 背景 微软模拟飞行2020的地景使用了Bing的卫星地图,然而卫星地图比较老旧,很多地区都是几年前的图设置直接是没有的。这种现象在全球不同地区

hesicong 272 Dec 24, 2022
Python bindings and utilities for GeoJSON

geojson This Python library contains: Functions for encoding and decoding GeoJSON formatted data Classes for all GeoJSON Objects An implementation of

Jazzband 765 Jan 6, 2023
Python bindings and utilities for GeoJSON

geojson This Python library contains: Functions for encoding and decoding GeoJSON formatted data Classes for all GeoJSON Objects An implementation of

Jazzband 763 Dec 26, 2022
gjf: A tool for fixing invalid GeoJSON objects

gjf: A tool for fixing invalid GeoJSON objects The goal of this tool is to make it as easy as possible to fix invalid GeoJSON objects through Python o

Yazeed Almuqwishi 91 Dec 6, 2022
OSMnx: Python for street networks. Retrieve, model, analyze, and visualize street networks and other spatial data from OpenStreetMap.

OSMnx OSMnx is a Python package that lets you download geospatial data from OpenStreetMap and model, project, visualize, and analyze real-world street

Geoff Boeing 4k Jan 8, 2023
Tools for the extraction of OpenStreetMap street network data

OSMnet Tools for the extraction of OpenStreetMap (OSM) street network data. Intended to be used in tandem with Pandana and UrbanAccess libraries to ex

Urban Data Science Toolkit 47 Sep 21, 2022
prettymaps - A minimal Python library to draw customized maps from OpenStreetMap data.

A small set of Python functions to draw pretty maps from OpenStreetMap data. Based on osmnx, matplotlib and shapely libraries.

Marcelo de Oliveira Rosa Prates 9k Jan 8, 2023