Skip to content

Commit

Permalink
Merge pull request #355 from TID-Lab/remove_CT_UI
Browse files Browse the repository at this point in the history
Rename CT => FB in Aggie UI; remove old FB API
  • Loading branch information
cooperka committed Aug 18, 2020
2 parents 8127ca8 + 88e0c40 commit c377bae
Show file tree
Hide file tree
Showing 20 changed files with 24 additions and 509 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Aggie is a web application for using social media and other resources to track i
Aggie can retrieve data from several sources:

* [Twitter](https://search.twitter.com) (tweets matching a keyword search)
* [Facebook](https://facebook.com) (comments from publicly accessible groups and pages)
* [Crowdtangle](https://www.crowdtangle.com/) (Facebook, Instagram, and Reddit posts from publicly accessible groups and pages)
* [RSS](http://en.wikipedia.org/wiki/RSS) (article titles and descriptions)
* [ELMO](http://getelmo.org) (answers to survey questions)

Expand Down Expand Up @@ -243,13 +243,6 @@ Set `config.adminParty=true` if you want to run tests.
1. Follow [these instructions](https://developer.twitter.com/en/docs/basics/authentication/oauth-1-0a/obtaining-user-access-tokens) to generate tokens to use the Twitter API.
1. Go to Settings > Configuration and edit the Twitter settings. Remember to toggle the switch on, once you have saved the settings.

#### Facebook

1. Visit [your apps](https://developers.facebook.com/apps/) on the Facebook developers site. Create a new app if needed.
1. Inside your Facebook app, obtain `client_id` and `client_secret`.
1. To obtain an access token, in a browser, visit `https://graph.facebook.com/oauth/access_token?client_secret=xxx&client_id=xxx&grant_type=client_credentials` using your `client_id` and `client_secret`.
1. Go to Settings > Configuration and edit the Facebook settings. Remember to toggle the switch on, once you have saved the settings.

#### CrowdTangle

1. Create a dashboard on CrowdTangle and generate the dashboard token.
Expand Down
3 changes: 0 additions & 3 deletions config/secrets.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"language": "en",
"zawgyiProb" : 0.9
},
"facebook": {
"accessToken": "Enter Access Token"
},
"elmo": {
"authToken": "Enter Auth Token"
},
Expand Down
32 changes: 1 addition & 31 deletions docs/content/settings/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Fetching can be enabled or disabled by toggling ON/OFF the fetching toggle. To t

![Media Authentication](toggle3.png)

3. Click on **Edit** to authenticate the Twitter, Facebook or Elmo feed settings.
3. Click on **Edit** to authenticate the Twitter, Crowdtangle, or Elmo feed settings.

![Media Authentication](social_media_feed_authentication.png)

Expand Down Expand Up @@ -60,36 +60,6 @@ Fetching can be enabled or disabled by toggling ON/OFF the fetching toggle. To t

6. With these access tokens, fellow the instructions from [Adding Media Feeds to Aggie](#adding-media-feeds-to-aggie) section and edit the Twitter settings in Aggie.

### Facebook API Access Tokens


1. Visit [Facebook's Apps page](https://developers.facebook.com/apps/) and login with your credentials.
2. Click on **Create a new app** at the top right corner.

![Facebook Apps](facebook_app1.png)

3. Type in the *name* of your app and click on **Create New Facebook App ID**.

![Facebook Apps](facebook_app2.png)

4. Type in your *email address* and choose the *app category*, eg. *Apps for Pages* and click on **Create App ID**.

![Facebook Apps](facebook_app3.png)

5. Select the pictures that apply and click **Submit**.
6. Enter a *site URL* and click on **next**.
7. Click **Skip to Developer Dashboard** to retrieve your *App ID* and *App Secret*.

![Facebook Apps](facebook_app4.png)

8. Click on the **Show button** and enter your password to show your *App Secret*.

![Facebook App](facebook_app5.png)

9. Now with your Facebook *App ID* and *App Secret*, copy **https://graph.facebook.com/oauth/access_token?client_secret=xxx&client_id=xxx&grant_type=client_credentials** into your web browser, replacing the (**xxx**) in **secret = xxx** and **id=xxx** with your *App Secret* and *App ID* respectively.
10. Hit the return key to show your access token.
11. With this access token,fellow the instructions from [Adding Media Feeds to Aggie](#adding-media-feeds-to-aggie) section and edit the Facebook settings on Aggie.

### WhatsApp messages

The WhatsApp feature is documented in a [conference paper](http://idl.iscram.org/files/andresmoreno/2017/1498_AndresMoreno_etal2017.pdf). As WhatsApp does not currently offer an API, a Firefox extension in Linux is used to redirect notifications from [web.whatsapp.com](http://web.whatsapp.com) to Aggie server. Thus, you need a Linux computer accessing WhatsApp through Firefox for this to work. Follow these steps to have it working.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/usingaggie/usingaggie.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### What is a Source?

Sources are the social media platforms such as *Twitter, Facebook, Ushahidi, and RSS feeds* that Aggie crawls through to aggregate reports relevant to the event being monitored.
Sources are the social media platforms such as *Twitter, Crowdtangle, Ushahidi, and RSS feeds* that Aggie crawls through to aggregate reports relevant to the event being monitored.

Sources can also be services that send reports directly to Aggie. Currently, we have implemented support for WhatsApp and [SMSGH](https://hubtel.com/messaging/), a service that forwards SMS text messages sent to [short codes](https://en.wikipedia.org/wiki/Short_code).

Expand Down
2 changes: 1 addition & 1 deletion lib/fetching/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fetching Module

This module is responsible for pulling/receiving content from sources specified by the user (Twitter, Facebook, RSS, etc.)
This module is responsible for pulling/receiving content from sources specified by the user (Twitter, Crowdtangle, RSS, etc.)

It runs in the background as its own process and reads source definitons from the database. It is notified via inter-process communication when sources have changed.

3 changes: 0 additions & 3 deletions lib/fetching/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ Bot.prototype._reportListener = function(reportData) {
if (reportData._media === 'twitter') {
reportData.metadata.retweet ? reportData.tags.push('RT') : reportData.tags.push('NO_RT');
}
if (reportData._media === 'facebook') {
reportData.metadata.isComment ? reportData.tags.push('FBComment') : reportData.tags.push('FBPost');
}
if (reportData._media === 'crowdtangle') {
true ? reportData.tags.push(reportData.metadata.ct_tag) : reportData.tags.push('Untagged');
}
Expand Down
1 change: 0 additions & 1 deletion lib/fetching/content-service-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var _ = require('underscore');

var contentServices = {};
contentServices.elmo = require('./content-services/elmo-content-service');
contentServices.facebook = require('./content-services/facebook-content-service');
contentServices.rss = require('./content-services/rss-content-service');
contentServices.twitter = require('./content-services/twitter-content-service');
contentServices.dummy = require('./content-services/dummy-content-service');
Expand Down
196 changes: 0 additions & 196 deletions lib/fetching/content-services/facebook-content-service.js

This file was deleted.

4 changes: 0 additions & 4 deletions lib/fetching/content-services/test-content-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ var testContentService = function(service, settings, callback) {
var t = new Twit(settings);
t.get('account/verify_credentials', { skip_status: true }, callback);
break;
case 'facebook':
graph.setAccessToken(settings.accessToken);
var graphObject = graph.get('4', callback); // We ask for Mark's userId
break;
default:
var err = { message: 'There is not test available for this setting' };
callback(err, {}, {});
Expand Down
2 changes: 1 addition & 1 deletion models/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var urlValidator = function(url) {
)
}

var mediaValues = ['facebook', 'crowdtangle', 'elmo', 'twitter', 'rss', 'dummy', 'smsgh', 'whatsapp', 'dummy-pull', 'dummy-fast'];
var mediaValues = ['crowdtangle', 'elmo', 'twitter', 'rss', 'dummy', 'smsgh', 'whatsapp', 'dummy-pull', 'dummy-fast'];

var sourceSchema = new mongoose.Schema({
media: { type: String, enum: mediaValues },
Expand Down
4 changes: 2 additions & 2 deletions public/angular/js/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
angular.module('Aggie')

.value('mediaOptions', ['twitter', 'facebook', 'rss', 'elmo', 'smsgh', 'whatsapp', 'crowdtangle'])
.value('mediaOptions', ['twitter', 'rss', 'elmo', 'smsgh', 'whatsapp', 'crowdtangle'])

.value('apiSettingsOptions', ['twitter', 'facebook', 'elmo', 'gplaces'])
.value('apiSettingsOptions', ['twitter', 'elmo', 'gplaces', 'crowdtangle'])

.value('widgetSettingsOptions', ['incident map'])

Expand Down
2 changes: 1 addition & 1 deletion public/angular/js/controllers/sources/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ angular.module('Aggie')

$scope.sourceClass = function(source) {

var mediaOptions = ['twitter', 'facebook', 'rss', 'elmo', 'smsgh', 'whatsapp', 'crowdtangle'];
var mediaOptions = ['twitter', 'rss', 'elmo', 'smsgh', 'whatsapp', 'crowdtangle'];

if (mediaOptions.indexOf(source.media) !== -1) {
return source.media + '-source';
Expand Down
6 changes: 1 addition & 5 deletions public/angular/sass/components/tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ tbody {
background: url('/images/elmo.png') no-repeat 0 50%;
}

.facebook-source {
background: url('/images/facebook.png') no-repeat 0 50%;
}

.rss-source {
background: url('/images/rss.png') no-repeat 0 50%;
}
Expand All @@ -161,7 +157,7 @@ tbody {
}

.crowdtangle-source {
background: url('/images/crowdtangle.png') no-repeat 0 50%;
background: url('/images/facebook.png') no-repeat 0 50%;
}
.unknown-source {
position: relative;
Expand Down
Loading

0 comments on commit c377bae

Please sign in to comment.