Unofficial Ruby Wrapper for Hurriyet API - http://developers.hurriyet.com.tr/
$ gem install hurriyet
require 'hurriyet'
client = Hurriyet::Client.new(<YOUR_API_KEY>)
client.articles.all
# Get all articles
client.articles.all
# Get a single article
client.articles.single(40220736)
# Get all columns
client.columns.all
# Get a single column
client.columns.single(40220397)
# Get all galleries
client.news_photo_galleries.all
# Get a single gallery
client.news_photo_galleries.single(40220735)
# Get all pages
client.pages.all
# Get a single page
client.pages.single('55e861bc6534652c108afa2f')
# Get all paths
client.paths.all
# Get a single path
client.paths.single('563cddcc67b0a934e44ee2d7')
# Get all writers
client.writers.all
# Get a single writer
client.writers.single('570167e867b0a90bdc503452')
Hurriyet API allows you to filter, select and limit the resources you fetch. Here is how:
- $select: Select only 1 column from incoming resources.
- $top: Limit response resources.
- $filter: Filter incoming resources. See here for more info.
# Takes 3 articles.
client.articles.all top: 3
# Takes 3 articles of which path equals to 'gundem'
client.articles.all top: 4, filter: 'Path eq \'gundem\''
# Selects title of articles of which title contains word 'Istanbul'
client.articles.all filter: 'contains(Title, \'Istanbul\')', select: 'Title'
This project is licensed under the terms of the MIT license.