Code Monkey home page Code Monkey logo

logoservice's Introduction

LogoService

Getting a Image for a Brand From Twitter.

I have always found a need to get a logo for a name, may be a Brand Name, Organization or anything. No public serivce is available for this. For this use case I have found a simple way of getting it from twitter.

For this use case, we will get the list of nouns from a brand name and search for users on twitter with those nouns. In the list of users so retreived we will use the profile image of user which as highest Followers/Following ratio.

Getting Started

Installation
npm install logoservice --save
Usage

Using service

var logoService = require('logoservice');
var LogoService = new logoService(TWITTER_CONFIG, RETURN_FIRST_RESULT);

TWITTER_CONFIG is the configuation of twitter application:

{
    consumer_key: '<VALUE>',
    consumer_secret: '<VALUE>',
    access_token_key: '<VALUE>',
    access_token_secret: '<VALUE>'
}

RETURN_FIRST_RESULT if set to true then first result is returned, if skipped or set to false then profile image of the best twitter account from the search result is returned.

Finally getting logo

LogoService.getLogoForName(brandname, function(err, data) {
            if (err || !data) {
                console.log('Unable to find logo correctly');
                console.log(err);
                sendResponse(404, '', res);
            } else {
                res.writeHead(302, {
                    'Location': data
                });
                res.end();
            }
        });

logoservice's People

Contributors

priyank2005 avatar

Stargazers

Pradeep Bhadani avatar

Watchers

James Cloos 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.