npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

twitter-smart-geo-stream

v0.1.2

Published

...

Downloads

9

Readme

Twitter Smart Geospatial Stream

Build Status npm version npm download counter

Dependency Status devDependency Status

NodeICO

Known Vulnerabilities Known Vulnerabilities

This project uses only stream of geospatial data coming from public Twitter stream.

It is an outcome of my geospatial analysis of the available data and tries to utilize my personal experience to prevent others from time wasting processes with data harmonozation.

I tried to use machine learning methods to learn current parameters of the stream and then offers to store and further analyze only relevant data.

See input parameters which vary depending on required analysis.

Project offers to:

  • collect variable samples of the stream and do some analytics
  • provide results of test on sammples
  • create DB and collections on provided connection and store data
  • download and store only relevant data separately (filter or throw away data that you don't need)

Requirements

Install (optional): PostgreSQL https://www.pipelinedb.com/download MongoDB https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ Redis http://redis.io/download

Installation

npm install twitter-smart-geo-stream npm install twitter-smart-geo-stream --save (as dependency for your own modules)

Dependencies

npm install package.json (for development)

Usage

For usage see examples/exampleFile.js ... Basically you have set something like this:

var parameters = {
    /*  GENERAL
     *  keywords - for details see https://dev.twitter.com/streaming/overview/request-parameters#track
     *  some place or world = [ '-180.0','-90.0','180.0','90.0'];
     */
    track:              'apple',
    locations:          ['-125','20','-101','50'],
    verbose:            'production',   // 'production' 'debug'

    sampleSize:         5,              // any number OR 0 as infinity
    calcStats:          true,           // true - false
    verbose:            'production',   //'production' - 'debug'

    /* Twitter access and Twit module settings
     * GRAB YOUR KEYS AT https://apps.twitter.com/
     */
    consumer_key:       'aaa',
    consumer_secret:    'bbb',
    access_token:       'ccc',
    access_token_secret:'ddd',
    // optional HTTP request timeout to apply to all requests.
    timeout_ms:         10 * 1000,

    /*
     * STORAGE CONNECTION
     */
    createNewDb:        false,          // change or use detault
    indexMongo:         false,
    indexPg:            false,
    // MongoDB
    useMongoDB:         false,          // change or use detault
    hostMongo:          'localhost',    // change or use detault
    portMongo:          '27017',        // change or use detault
    dbMongo:            'twittersgs',   // change or use detault
    // PostgreSQL
    usePg:              false,          // change or use detault
    hostPg:             'localhost',    // change or use detault
    portPg:             '5432',         // change or use detault
    dbPg:               'twittersgs',   // change or use detault
    // Redis
    useR:               false,
    hostR:              '192.168.99.100',// default for Docker container, otherwise 127.0.0.1:6379
    portR:              '32768',
    dbR:                'twittersgs',

    /*
     *  FILTER
     */
    inclRetweets:        true,          // true - false

    checkContent:       false,          // true - false
    contentWord:        false,          // true - false

    checkSource:        true,           // true - false
    sourceType:         'human',
    // category of source classification
    // for details see './data/tweetSource.csv' - 'all' 'human' 'web device'
    // 'mobile devices' 'meteo' 'earthquakes' 'trends' 'traffic'

    checkSpam:          false,          // true - false
    checkByLocation:    false,          // true - false

    /*
     *  IMPROVE and REPAIR
     */
    calcPlaceCenter:    true,           // true - false
    calcPlaceCenterL:   'all',          // 'all' 'country' 'city' 'neighbourhood' 'poi'

    castDateString:     true,           // true - false
    calcLocalTime:      true,           // true - false

    checkLanguage:      true,           // true - false
    calcSentiment:      true,           // true - false

    /*
     *  OPTIMIZE
     */
    geoparse:           false           // true - false
    tweetSaveSize:      'full',         // full - medium - small
    delUserMd:          false,          // true - false
    delPlaceMd:         false,          // true - false

    /*
     * CREATE DERIVED DATASETS
     */
    buildUserNetwork:   false,          // true - false
    buildTopicNetwork:  false,          // true - false
    buildUsersDb:       false,          // true - false
    buildPlaceDb:       false           // true - false
};

TSGS.twitterSGSstart(parameters);       // START WITH THIS COMMAND !!!

TODO - Tests

It is required to write tests. Please look to './test/twitterSGS.test.js'. Start test with:

npm test

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

For further classification and commit of source devices see './data/tweetsources.csv' (with LibreOfficeCalc) and create also './data/tweetsources.js' to use it in the project.

Scientific publication

For more details please read:

TO BE ANNOUNCED

Release History

based on http://semver.org/

  • 0.1.2 ...
  • 0.1.1 major changes but still buggy
  • 0.1.0 Initial release