Git Product home page Git Product logo

poptags's Introduction

poptags

Trending tweets mapped to top (relevant) Instagram photos

This application gets the top trending tweets worldwide and gets the top Instagram photos with the same hashtags.

index.js

returns instagram photos runs twitter and instagram calls outside of reqs to root page

twitter.js

returns top tweets worldwide

instagram.js

gets instagram photos using the trending twitter topics.

poptags's People

Contributors

marcomarandiz avatar saiichihashimoto avatar

Watchers

 avatar Robin Beechey avatar

poptags's Issues

twit not in package.json

rm -rf node_modules
npm install
npm start

Gives you this error:

Error: Cannot find module 'twit'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at /Users/saiichi/Workspace/poptags/routes/twitter.js:2:16
    at Object.<anonymous> (/Users/saiichi/Workspace/poptags/routes/twitter.js:24:2)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

instagram.js could be more efficient

Right now, instagram.js a big async.waterfall. The first function uses async.map to call ig.tag_search on each trend to get an instagram tag for each twitter trend. The next function uses another async.map to get those tags and run ig.tag_media_recent on each 50 times so we can change each tag into 100 pictures. In other words, you have one map feeding into another map. Cool.

The problem here is that ig.tag_search could run really quickly for one ig.tag_search but not for some others, but that first result won't move onto its 50 ig.tag_media_recents, because nothing in the second async.map will run until the first one is completely done.

TLDR; Have an async.map that has an async.waterfall inside of it instead of the other way around so each async.map isn't blocking the one before it.

PS. If one ig.tag_search or ig.tag_media_recent errors, you want to throw away that result, but not all of them, right? Right now, an error anywhere will tell everything to quit.

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.