File: twitter-streaming/node_modules/ntwitter/test/trend.js

Recommend this page to a friend!
  Classes of Igor Escobar   Terminal Crossword   twitter-streaming/node_modules/ntwitter/test/trend.js   Download  
File: twitter-streaming/node_modules/ntwitter/test/trend.js
Role: Example script
Content type: text/plain
Description: Example script
Class: Terminal Crossword
Generate a crosswords board on a text console
Author: By
Last change:
Date: 2 years ago
Size: 1,207 bytes
 

Contents

Class file image Download
var ntwitter = require('../index.js'), mocha = require('mocha'), should = require('should'), fs = require('fs'), config = JSON.parse(fs.readFileSync('./config.json')); var twitter = new ntwitter({ consumer_key: config.key, consumer_secret: config.secret, access_token_key: config.token_key, access_token_secret: config.token_secret }); describe('Twitter Trend API', function() { it('Origin getTrends still work', function(done) { twitter.getTrends(function(err, data) { data[0].trends.should.not.be.empty; done(); }); }); it('Origin getCurrentTrends still work', function(done) { twitter.getCurrentTrends(function(err, data) { data[0].trends.should.not.be.empty; done(); }); }); it('GET trends/:woeid data without earth id', function(done) { twitter.getTrendsWithId(null, function(err, data) { data[0].trends.should.not.be.empty; done(); }); }); it('GET trends/:woeid data wih earth id', function(done) { twitter.getTrendsWithId('23424977', function(err, data) { data[0].trends.should.not.be.empty; data[0].locations[0].name.should.equal('United States'); done(); }); }); });