Touch your data for the first time!
This started off as an experiment in using D3 to display tweets collected from a Python script. I looked for a way to see Twitter trends on a US map, nothing really tickled me. Over time, I added features requiring a true server, settling on NodeJS for the backend. I made it a web framework so that people can interact with their data easier. Continue if you like.
- Install Postgres, use the link to download: http://www.postgresql.org/download/
- Install NodeJS, use the link to download: https://nodejs.org/en/download/
- The app uses data from the Twitter API, here are steps to get credentials to use it:
- 1. Sign up for a Twitter account, unless you already have one: https://twitter.com/
- 2. Sign in to the Apps Management Site: https://apps.twitter.com/
- 3. Click on Create New App to continue.
- 4. Fill out the fields for your app and agree to the Developer Agreement.
- 5. Click on Create your Twitter application to continue.
- 6. Click to view the tab called Keys and Access Tokens for the app.
- 7. Click Create my access token on the bottom to continue.
- 7. Create a new file called credentialsTwitter.json.
- 8. Save the file under TNode->router.
- 9. Add a JSON dictionary with the keys: Consumer_Key, Consumer_Secret, Access_Token, and Access_Token_Secret. Then set the values for these keys into the dictionary. Use the tab on Twitter as reference.
- 10. Save the JSON dictionary to the file.
- 1. Create a new file called credentialsDB.json.
- 2. Save the file under TNode->router.
- 2. Click on the Postgres application to start the PostgreSQL Server on your machine.
- 3. Open psql, the command line interface for your PostgreSQL server.
- 4. If your server is not password-secured, run the following command: ALTER ROLE your_username WITH PASSWORD 'your_password';
- 5. If you haven't made a database yet, run the following command: CREATE DATABASE your_db_name;
- 6. Add a JSON dictionary with the keys: username, password and dbname. Then set the values for these keys into the dictionary as you set before.
- 7. Save the JSON dictionary to the file.
- 1. Open terminal and cd into the TNode directory.
- 2. To setup nodemon on your machine, run the following command: npm install -g nodemon
- 3. To start the server, run the following command: nodemon server.js
- 4. If it all succeeds, the terminal will say 'the api is running'.
This project can use your help. Submit a pull request or open an issue to get started. For any questions, comments, or concerns, please send me a message at [email protected]
- Adjusting Points on Zoom: http://jsfiddle.net/o3dxgfuu/12/
- Zoom into State: http://bl.ocks.org/mbostock/2206590
- FIPS code to population and land area data: http://quickfacts.census.gov/qfd/download_data.html
- FIPS code to state, county name: http://www.schooldata.com/pdfs/US_FIPS_Codes.xls
- TopoJSON files for D3 rendering: http://bl.ocks.org/mbostock/raw/4090846/us.json
- Choropleth coloring: http://bl.ocks.org/mbostock/4060606