Git Product home page Git Product logo

hyve's Introduction

Hyve

http://github.com/Tawlk/hyve

About

Hyve (pronounced: "hive") is a javascript library aiming to be a general solution for streaming the latest data from multiple social media networks, for any given topic, and abstracting all of them into one simple API.

Current Features

  • Plays nice with all major JS frameworks (jQuery, Mootools etc.)
  • Can run any javascript function of your choice against each posting retrieved.
  • Outputs all data in a normalized format - USMF
  • Supports searching Facebook, Twitter, Identica, Foursquare, Flickr, Picasa, Wordpress, Youtube, Reddit, Digg, and Delicious
  • Indirectly supports Imgur and Vimeo by catching links shared via other services.
  • Expands urls from t.co and bitly
  • Streams from all services (default), or optionally only selected services
  • Runs in the browser or on the server (Node.js)

Requirements

For running Hyve in Node.js, you'll need the request library. You can grab it from npm:

$ npm install request

Usage / Installation

Arguments:

hyve.stream(search_terms,callback_function,optional_service_list)

Simple echo of Twitter, Facebook, and Identica with pure JS:

var myFunction = function(data){console.log(' + data.service +' : '+ data.text  +')}
var myQuery = 'android'
var myServices = ['Twitter','Facebook','Identica']

hyve.stream(myQuery,myFunction,myServices)

Simple Node.js example to output data from all services:

var hyve = require('hyve')

hyve.stream('android', function(data){
    console.log(data.service +' : '+ data.text);
})

Basic live search engine with jQuery:

<!DOCTYPE HTML>
<html>
    <head>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
        <script src="hyve.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('#search').bind("click",function(){
                    query=$('#query').val();
                    hyve.stream(query,function(data){
                        $('#output').prepend($('<p>' + data.service +' : '+ data.text  +'</p>'))
                    });
                });
            });
        </script>
    </head>
    <body>
        <div id="input">
            <input id="query" type="text" />
            <button id="search">search</button>
        </div>
        <div id="output"></div>
    </body>
</html>

Notes

Foursquare will only return data if the client has HTML5 Geolocaton support. You must also define client_id and client_secret like so:

    hyve.feeds.foursquare.client_id = 'your_application_client_id'
    hyve.feeds.foursquare.client_secret = 'your_application_client_secret'

Flickr will work without authentication, however 'views' is not returned without auth. Without 'views' the 'weight' metric will be set to 0.

To get 'views' in Flickr you must specify an API key like so:

    hyve.feeds.flickr.api_key = 'your_api_key',

To utilize bitly url un-shortening you must supply a login and api_key:

    hyve.feeds.bitly.login = 'your_username'
    hyve.feeds.bitly.api_key = 'your_api_key'

Questions/Comments? Please check us out on IRC via irc://freenode.net/#tawlk

hyve's People

Contributors

insin avatar lrvick avatar robotlolita avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.