| 1 |
======================================================================== |
| 2 |
CasaLens Project Overview |
| 3 |
======================================================================== |
| 4 |
|
| 5 |
CasaLens is a data mash-up sample i.e use the Casablanca features to build a service that can collate data from different services and provide them to the user. |
| 6 |
Given the postal code/city name, the service overlays events, movies, weather, pictures around the place. |
| 7 |
|
| 8 |
To run the sample, obtain the api keys from the different services (listed below) and update them in casalens.cpp (see Services section below for more details). |
| 9 |
The sample takes one parameter: the port to listen for requests. |
| 10 |
|
| 11 |
Services: |
| 12 |
Here are the details about the services the sample is interacting with, how to obtain the api keys for using these services and how to pass it to the sample. |
| 13 |
1. Bing image search: http://datamarket.azure.com/dataset/bing/search |
| 14 |
Sign UP at the above link to obtain the api key. |
| 15 |
In casalens.cpp, set the value of bmaps_key variable to this key. |
| 16 |
Query this service for pictures of a place and return it to the client. |
| 17 |
This service is also used to collect movie posters. |
| 18 |
|
| 19 |
2. OpenWeatherMap:http://openweathermap.org/ |
| 20 |
Fetch weather data: current temperature, pressure at the location. |
| 21 |
|
| 22 |
3. Eventful: http://http://api.eventful.com/ |
| 23 |
Follow the "Get Started" steps -> "Register a new account" at the eventful website to obtain the application key. |
| 24 |
In casalens.cpp, set the value of events_key variable to this key. |
| 25 |
Fetch different events happening at the specified location. |
| 26 |
|
| 27 |
4. OnConnect tmsapi: http://developer.tmsapi.com/ |
| 28 |
Register at the above website and obtain a new key for the TMS API package. |
| 29 |
In casalens.cpp, set the value of movies_key variable to this key. |
| 30 |
Get currently playing movies in local theaters along with the show times. |
| 31 |
|
| 32 |
5. Google maps: https://developers.google.com/maps |
| 33 |
This does not require a key. |
| 34 |
Given a postal code, use google maps API to get the location (city name) corresponding to that code. |
| 35 |
|
| 36 |
6. Bing maps: http://dev.virtualearth.net/ |
| 37 |
The key populated in step 1 should work for both bing maps and search. |
| 38 |
Given a location (city name), use bing maps API to get the postal code. |
| 39 |
|
| 40 |
Files: |
| 41 |
1. casalens.cpp: |
| 42 |
Main file that contains code to initialize and start the http_listener. |
| 43 |
We add two GET and POST handlers handle_get and handle_post and open the listener to listen for requests. |
| 44 |
|
| 45 |
2. datafetcher.cpp: |
| 46 |
This file contains logic to collect data from different services, create JSON objects with the data and return it to the client. |
| 47 |
|
| 48 |
This sample is merely a demonstration of how one can use Casablanca to author data mash-ups. |
| 49 |
If you plan to use/deploy the sample, do not forget to read and follow the "Terms and Conditions" for each service and ensure that you are adhering to all the requirements. |