The following is a number of interesting / useful solutions to problems, or recipes, written in Moya code.
The following one liner will retrieve the current price of Bitcoin (in USD) from https://www.bitstamp.net:
How does this work? Well, the URL https://www.bitstamp.net/api/ticker/ contains a JSON object with the current Bitcoin prices. The get: modifier reads that request from the internet, and the fromjson: modifier converts the text in to a dictionary with a number of values. Finally the index operator
['ask'] looks up the value of
'ask' which is the current asking price.