Awesome
Requirements
Setting up
1. Setup the postgres database:
CREATE DATABASE furland;
CREATE USER furland WITH PASSWORD 'abc123';
ALTER DATABASE furland OWNER TO furland;
GRANT ALL PRIVILEGES ON DATABASE furland TO furland;
2. Setup node.js:
- Go inside the
ClientApp
directory - Run
npm install
3. Twitter App
- Go to Twitter Developer site
- Set the Redirect URI as "https://localhost:44417/validate/twitter"
- Save the "API key" and "API secret key"
Building Instructions
- Modify
appsettings.json
with the Twitter configuration and the database connection string. - Use Visual Studio, or use
dotnet run
.
Note: Twitter only provides 15 API calls per 15 minutes per user authenticated on the website. If you are by yourself and your account has 500 friends, it would take 500 minutes (8 hours) to gather the follower of all your friends. It may be recommended to have your friends log-in into the website a well.
Releasing
#build
dotnet publish -c Release
# copy files to server
scp -r * ely:~/furland
# run server
dotnet ./FurlandGraph.dll --urls http://0.0.0.0:80
Architecture
- User logs in with Twitter account on TwitterController.cs
- User requests for status update on GraphController.cs, which goes into StatusService.cs
- The status update checks what work items need to be created for the graph next
- Stage 1: Download the user's profile + friends
- Stage 2: Download the user's friends's profiles
- Stage 3: Download the user's friends's friends
- Stage 4: Calculate the proximity matrix
- The user profiles and user friend data is processed by the HarvestService.cs
- The matrix is calculated on MatrixService.cs
- User downloads the matrix into the browser