news-ai / social

Getting data from rss, instagram, and twitter.
https://app.keymetrics.io/#/bucket/57fe822672900b983297f577/dashboard
3 stars 0 forks source link

social

Dashboard

Getting data from RSS, Instagram, and Twitter through Pub/Sub, and Google Compute Engine.

Feed loops through all the feeds in the API that haven't been processed. It calls the RSS function for each feed. The RSS function gets the RSS headlines and writes them to ES.

Deployment notes

pm2 start app.js -i max

Services to start (in this order):

RSS

Deployed on Google Compute Engine. Just need to send information to the Pub/Sub topic: process-rss-feed.

function testProcess() {
    var data = {};
    data.publicationId = 6539064085839872;
    data.url = 'http://pagesix.com/author/cindy-adams/feed/';
    return getContent(data);
};

Pub/Sub call:

{
    "url": "http://pagesix.com/author/cindy-adams/feed/",
    "publicationId": 6539064085839872
}

Feeds

Deployed on Google Compute Engine. Will run periodically to check any feed that needs to get fetched. The input is data from the datastore, and the output is a pub/sub call to process-rss-feed with username. 2 functions:

  1. Get initial data for Twitter user and 20 posts (new)
  2. Get new tweets as they come in (stream)

Twitter

Pub/Sub call:

{
    "username": "abhiagarwal"
}

Instagram

3 functions:

  1. Get initial data for Instagram user and posts (new)
  2. Repeatedly keep the data up to date (sync (posts & profiles))
  3. Get new posts as they come out (stream)

Pub/Sub call:

{
    "username": "abhiagarwal"
}

Timeseries

Creating a timeseries of data for both Twitter and Instagram data.

Compute Engine

gcloud compute --project "newsai-1166" ssh --zone "us-east1-c" "social-1"

Microsoft Azure

ssh api@104.45.156.57