hurriyet 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 05f22fa971754bce6f74133e5ff9ba988a52cc75
4
+ data.tar.gz: f1d85ed870fc23ebaf471c2602957d18c6237067
5
+ SHA512:
6
+ metadata.gz: 736fc85fc07ef5b2efc0627aa762028bbae803e0724746ba65f0e9ffcc064e48e896782c1f86d8c897e1e9f45f4c72339709cc372a67f707d320f46d1bdecb62
7
+ data.tar.gz: fd28c1ead9c0b28980504e2723020ddf12287a867b9c169a9e9e55d1a0460fb0e9b8299e4e93efd5994b5e6302dc75b75810c338e886582a5ac8877a702c67eb
@@ -0,0 +1,13 @@
1
+ require 'hurriyet/service/article'
2
+ module Hurriyet
3
+ class Client
4
+ attr_accessor :apikey
5
+ def initialize(apikey)
6
+ @apikey = apikey
7
+ end
8
+
9
+ def articles
10
+ Service::Article.new self
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ module Hurriyet
2
+ module ApiOperation
3
+ module List
4
+ def all
5
+ execute endpoint
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,14 @@
1
+ require 'hurriyet/service/base'
2
+ require 'hurriyet/service/api_operation/list'
3
+ module Hurriyet
4
+ module Service
5
+ class Article < Base
6
+ attr_accessor :client
7
+ include ApiOperation::List
8
+
9
+ def endpoint
10
+ 'articles'
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,23 @@
1
+ require 'faraday'
2
+ module Hurriyet
3
+ module Service
4
+ class Base
5
+ attr_accessor :client
6
+
7
+ def initialize(client)
8
+ @client = client
9
+ @conn = Faraday.new(url: 'https://api.hurriyet.com.tr', headers: { apikey: @client.apikey })
10
+ end
11
+
12
+ def execute(endpoint)
13
+ p @conn
14
+ p "/#{version}/#{endpoint}"
15
+ @conn.get("/#{version}/#{endpoint}").body
16
+ end
17
+
18
+ def version
19
+ 'v1'
20
+ end
21
+ end
22
+ end
23
+ end
data/lib/hurriyet.rb ADDED
@@ -0,0 +1,4 @@
1
+ require 'hurriyet/client'
2
+ require 'hurriyet/service/article'
3
+ module Hurriyet
4
+ end
data/lib/main.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'hurriyet.rb'
2
+ h = Hurriyet::Client.new '9a9dcb9808624ac69e6c557a192afb33'
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hurriyet
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Yigit Ozkavci
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-09-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.9.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.9.2
27
+ description: Ruby wrapper for developers.hurriyet.com API.
28
+ email: yigitozkavci8@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - lib/hurriyet.rb
34
+ - lib/hurriyet/client.rb
35
+ - lib/hurriyet/service/api_operation/list.rb
36
+ - lib/hurriyet/service/article.rb
37
+ - lib/hurriyet/service/base.rb
38
+ - lib/main.rb
39
+ homepage: http://rubygems.org/gems/hurriyet
40
+ licenses:
41
+ - MIT
42
+ metadata: {}
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubyforge_project:
59
+ rubygems_version: 2.4.6
60
+ signing_key:
61
+ specification_version: 4
62
+ summary: Hurriyet API Wrapper
63
+ test_files: []
64
+ has_rdoc: