Giter VIP home page Giter VIP logo

fraudtweets's Introduction

Fraud Detection for twitter

The purpose of this program is to detect fraud on twitter. It does this by targeting a specific companies handle (for example @sprint). It then will read any twitter user that complains to @sprint and begins monitoring for people responding to that tweet that are offering help. If they are not an official supported account then they are marked as fraudulent.

How it works

1) Find tweets complaining

  • Twitter API to read tweets @handle
  • Nodejs sentiment to determine if tweet is a complaint
  • If tweet is a complaint store using MongoDB

2) Find replies

  • Use Twitter API to search the handle of the people who tweeted @handle
  • Match in_reply_to_status_id_str to complaining tweet
  • Determine if helpful
    • Note: Currently this simply searches through a list of monitored common words. in the future TF-IDF could be used monitoring the official account.
  • Verify replying users account
  • Store relevant info in MongoDB

3) Display results

  • Standard HTML, CSS, and JavaScript front extended
  • PassportJS local login method
  • Users stored in Nodejs
  • Stylized datatables plugin to show tweet info

Requirements

  • In high volume case ass many twitter app keys can be used as are required and will function in a round robin manner.
  • Nodejs
  • MongoDB

Setup

Install MongoDB

Setup config file like follows

  • server/config/authorization.json
{
  "url":"mongodb://localhost:27017/DBNAME",
  "port":3000,
  "debug":false,
  "keys":[
    {
      "CONSUMER_KEY":"",
      "CONSUMER_SECRET":"",
      "ACCESS_KEY":"",
      "ACCESS_SECRET":""
    },{
      "CONSUMER_KEY":"",
      "CONSUMER_SECRET":"",
      "ACCESS_KEY":"",
      "ACCESS_SECRET":""
    }
  ]
}

Install

Automated

1) Run install.js

cd WORKING_PATH/
node install.js

2) Start using prefered run method

3) Login with default account uname=ftweets password=superSecretPassword

Manual

1) Create MongoDB collections

db.createCollection("tweets")
db.createCollection("statistics")
db.createCollection("users")
db.createCollection("searches")

2) User collection in MongoDB

  • Salt to be implemented
{uname:"criggs626",password:"ijhzgdfiuhasdoifjaosifgadsf",email:"[email protected]",name:"Caleb Riggs"}

3) Searches collection in MongoDB

  • Required for searching tweets and verifying responses
{name : "Sprint", terms : [ "@sprint", "#sprint" ], verified : [ "sprintcare" ], lastID : [ "0", "0" ] }

4) Statistics collection in MongoDB

  • required for monitoring general statistics on the search terms
{name:"Sprint",count:0,negativeCount:0,averageScore:0,averageNegativeScore:0,validRepliesFound:0,fraudulentRepliesFound:0}

Running

  • Foreground

To run in the foreground simply navigate to the server and 'node' the index file.

cd WORKING_PATH/fraud/server/
node index.js
  • Background

For running in the background I recommend forever a node package. Once forever is installed follow same steps as above just 'forever start' instead of 'node'.

cd WORKING_PATH/fraud/server/
forever start index.js

Stats

  • 1,571 Lines of JavaScript

  • 429 Lines of HTML

  • 149 Lines of CSS

  • 123 Lines of MD (This totally counts...)

  • 2,272 Total Lines Written

Other Stats

  • โˆž Tacos Eaten

  • 2 Cats pet

  • 1 Hailstorm driven through

  • 0 Coffees drank

fraudtweets's People

Contributors

criggs626 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.