Code Monkey home page Code Monkey logo

golden-ticket's Introduction

Golden-Ticket

python version license

A Twilio-API SMS interface for finding the Golden Hour timings for your location.

What is the Golden Hour?

As quoted from Wikipedia:

In photography, the golden hour (sometimes known as magic hour, especially in cinematography) is a period shortly after sunrise or before sunset during which daylight is redder and softer than when the Sun is higher in the sky.

Set up

  1. This repository uses Python 3, and uses a virtualenv to standardize set-ups. Make sure you have pip installed and the repository cloned, and then run the following command in the main directory:
pip install -r requirements.txt
  1. Create an account on Twilio.

  2. Using the Twilio free trial, verify a potential number that you would want to use (this will be the number that is texting you).

  3. Install ngrok - this will be used to route any webhook calls from Twilio to your local machine.

  4. Verify a Phone Number on Twilio (https://www.twilio.com/console/phone-numbers/verified) that you would like to text.

  5. Run ngrok http 5000, this will create a link that Twilio can use to HTTP POST to (in this case when a message is received).

  6. Login to Twilio then navigate to Twilio Console -> Phone Numbers -> Manage Numbers -> Active Numbers -> < Your Number > , then in the box for Messaging -> A message comes in paste in the URL shown in ngrok. For instance https://e31wf4c9.ngrok.io/sms. Note that /sms is appended to the end, since that is how golden_hour.py is configured

Running the application

  1. Run the following command in the root directory of the repository
python3 golden_hour.py
  1. Send your Twilio number your location, and you'll get sent back the timings for the Golden Hour for your current day

  2. Go to a park, high building, mountain during those times and enjoy nature at its finest

Compatibility issues

Currently the application is configured to parse and return information on a message in a form like this 33°46′45″ N 94°23′24″ W. On an iPhone this format for your GPS location can be found by copying your location as shown in the native Compass application.

Logic

Using the following site to estimate getting the golden hour timings. In the code I use the difference between the end of civil twilight and sunset to estimate how long it takes the sun to go from 6° above the horizon to -4° above the horizon.

golden-ticket's People

Contributors

karvindass avatar

Watchers

 avatar

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.