Skip to content

Instantly share code, notes, and snippets.

@davidkelley
Created February 16, 2016 14:45
Show Gist options
  • Save davidkelley/3569fc6e00b7f07d1b82 to your computer and use it in GitHub Desktop.
Save davidkelley/3569fc6e00b7f07d1b82 to your computer and use it in GitHub Desktop.
Invisible App - Text Service

Text Service

Stockflare would like to provide a "text us" service, which enables users to text a SMS number with a particular Symbol and receive the latest information about that stock.

Example

Text: "aapl"

Response: "Apple Inc latest share price is $101.43 ($167.00/$96.00). Stockflare rates at 4/5. See more at: https://stockflare.com/stocks/aapl.o"
Text: "foo"

Response: "We couldn't find what you're looking for. You can search by any ticker symbol Why not try AAPL or NFLX."

Template

{{ short_name }} ({{ exchange_name }}) latest share price is {{ symbol % price }} ({{ fifty_two_week_high }}/{{ fifty_two_week_low }}). Stockflare rates at {{ rating }}/5. See more at: https://stockflare.com/stocks/{{ ric }}

Required data

Variable Method
short_name Available from search response
symbol Available by querying: GET:<api>/v1/fx/symbols and interpolating the value of currency_code key.
price Available from search response
fifty_two_week_high Available from search response
fifty_two_week_low Available from search response
rating Available from search response
ric Available from search response

Reference: https://www.twilio.com/blog/2015/09/build-your-own-ivr-with-aws-lambda-amazon-api-gateway-and-twilio.html

You can find an example of a lambda project here, please setup the project in a similar manner, so that deployment is trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment