### Sample News node ```javascript { "Id": "40230881", "ContentType": "Article", "CreatedDate": "2016-09-24T19:11:39.796Z", "Description": "Bundesliga'nın 5. haftasında Werder Bremen, Wolfsburg'u 2-1 mağlup etti, Mario Gomez yine gol atamadı.", "Files": [ { "FileUrl": "http://i.hurimg.com/i/hurriyet/98/0x0/57e6d06618c7731cd4529967.jpg", "Metadata": { "Title": "" } } ], "ModifiedDate": "2016-09-24T19:13:43.491Z", "Path": "/spor/futbol/", "Title": "Mario Gomez bunalımda: 4'te 0!", "Url": "http://www.hurriyet.com.tr/mario-gomez-bunalimda-4te-0-40230881" } ``` Installation Install using npm npm install hurriyet Usage Get an API key from https://developers.hurriyet.com.tr var hurriyet = require('hurriyet'); var h = new hurriyet('api token'); Article Callback Function var newsCallback = function(err, data) if (err) console.log(err); console.log(data); //console.log(data[0].Description); // Description of first node }; Get daily news h.Articles.getAll(newsCallback); // Get daily news h.Articles.getAll({limit:4},newsCallback); // Get top 4 daily news h.Articles.getAll({limit:4,select:'Description'},newsCallback); // Get top 4 daily news' descriptions Get single news from id h.Articles.getWithId(40199111,newsCallback); // Get news from id = 40199111 h.Articles.getWithId(40199111,{select:'Description'},newsCallback); // Get news' description from id = 40199111 // hurriyet.js var request = require('request'); var endpoint = 'https://api.hurriyet.com.tr/v1/'; var options = { url: '', headers: { accept: 'application/json', apikey: '' } }; // globefunc to api calls var callAPI = function (url,cb) { options.url = endpoint+url; function callback(error, response, body) { if (!error && response.statusCode == 200) { cb(error, JSON.parse(body)); }else{ cb(error, ''); } }; request(options, callback); }; var Hurriyet = function (apikey) { options.headers.apikey = apikey; }; Hurriyet.prototype = { Articles : function Articles(){ console.log('articles'); }, Columns : function Columns(){}, Date : function Date(){/*sadece date dondurecek*/}, NewsPhotoGallery : function NewsPhotoGallery(){}, Page : function Page(){}, Path : function Path(){} } Hurriyet.prototype.Articles = { ep : 'articles/', getAll : function(opts, callback){ if(typeof callback === 'undefined' && typeof opts === 'function'){ return callAPI('articles', opts); } if (typeof callback === 'function') { this.ep +='?' if(opts.filter) this.ep +='%24filter='+opts.filter; if(opts.select) this.ep +='&%24select='+opts.select; if(opts.limit) this.ep +='&%24top='+opts.limit; console.log(this.ep); return callAPI(this.ep, callback); } }, getWithId : function(id,opts,callback){ if(typeof opts === 'function'){ console.log('asd'); return callAPI(this.ep+id,opts); } if (typeof callback === 'function') { this.ep += id+'?%24select='+opts.select; return callAPI(this.ep, callback); } } }; Hurriyet.prototype.info = function () { console.log('Hurriyet !'); console.log('----'); } module.exports = Hurriyet;