Giter Site home page Giter Site logo

findmysteve's Introduction

FindMySteve

This is a stupid little Fly.io app/Python slackbot that let's folks see what city and country i'm in.

The Fly app runs everything in a single machine (pretty much. There's a separate database). Should these all be separate? Yes, probably.

How does it work?

The app runs an Owntracks server, specifically https://github.com/hrshadhin/ot-recorder. It let's you run any Owntracks clients and stores the results in a database. Postgres in this case. The slackbot is a python script that uses the slack_bolt library to run a simple slackbot that listens for the phrase "Where is steve?" Then it queries for the last location in the database, does some google API stuff to take that very precise location, find the city/region.country (whichever is most accurate), and return that with a little map of the area and the current time.

How do I run it?

You need a bunch of things, and I'll probably forget some of them.

These are the Fly.io secrets that need to be set (or just env vars if you're not running on Fly.io)

GOOGLE_API_KEY

You need some google api keys with the right permissions for the map apis.

SLACK_APP_TOKEN

You need this (again with a bunch of permissions) to do slack communication for the bot

SLACK_BOT_TOKEN

I still haven't quite figured out why you need two slack tokens. They do different things, sure, but it's all a bit confusing and I bet they could have made it more simple. I spent way too long figuring out the buttons i needed to press to get the permissions right.

I'll document this better if anyone is interested...

Copy the config.yml.example to config.yml and make the database details correct for your setup. Create an htpasswd file with a username and (encrypted) password. This will be your auth for the OwnTracks api.

Deploy to fly.

Once all of this is setup, you need to install OwnTracks on your phone. Should be available in the app store for your device. Configure the app so that the url is your apps url and the user and password are correct. You also probably need to edit the python script so that it has a different name from 'steve'.

I'm sure there are things i'm forgetting. Feel free to harrass me if you really want to make this work for yourself and can't work out the details.

findmysteve's People

Contributors

steveberryman avatar zifnab06 avatar

Stargazers

Moss Lilley avatar  avatar

Watchers

 avatar

Forkers

zifnab06

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.