hurriyet_cli 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/lib/hurriyet_cli/articles.rb +4 -4
- data/lib/hurriyet_cli/columns.rb +4 -4
- data/lib/hurriyet_cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b94b13b5c22dd0c4cac3fe7189f5e0667a8d4ced
|
4
|
+
data.tar.gz: 94cf9d8d6f7e11acb0036c59422251f7b90f9dd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30c31face20071561d013ef0ab496b24d64f5cbce20b615b43f2675c5f99e88dc0a572e2feff8ab95713e9e67b807744a937231ebcb8eca9121fcade6b10a899
|
7
|
+
data.tar.gz: c029ca5eeb7cdb7b601a1ff6d382ddbea2c7953587360d2bf92487df8ebbb449d6d542187d945ff80ff0cfa8e61170287fab2f9a967106a78a441a3517d2b045
|
data/README.md
CHANGED
@@ -23,8 +23,12 @@ Or install it yourself as:
|
|
23
23
|
Export your ```API_KEY``` that you get from [https://developers.hurriyet.com.tr](https://developers.hurriyet.com.tr)
|
24
24
|
|
25
25
|
```bash
|
26
|
-
$
|
27
|
-
|
26
|
+
$ export API_KEY=<YOUR_API_KEY>
|
27
|
+
```
|
28
|
+
|
29
|
+
```bash
|
30
|
+
$ hurriyet_cli articles # Fetch all articles
|
31
|
+
$ hurriyet_cli articles --top 5 # Fetch top 5 articles
|
28
32
|
```
|
29
33
|
|
30
34
|
## Thanks
|
@@ -17,10 +17,10 @@ module HurriyetCli
|
|
17
17
|
|
18
18
|
private
|
19
19
|
def formated_parse(articles)
|
20
|
-
articles.each do |a|
|
21
|
-
created_at = Time.parse(a["CreatedDate"]).strftime("%d/%m/%y
|
22
|
-
@display.
|
20
|
+
articles.each.with_index(1) do |a, i|
|
21
|
+
created_at = Time.parse(a["CreatedDate"]).strftime("%d/%m/%y | %H:%M")
|
22
|
+
@display.print "#{i} - #{Rainbow(a["Title"]).red} - #{Rainbow(created_at).color(:yellow)} \n #{Rainbow(a["Description"]).color(:dimgray)} \n #{Rainbow(a["Url"]).cyan} \n"
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
26
|
-
end
|
26
|
+
end
|
data/lib/hurriyet_cli/columns.rb
CHANGED
@@ -17,10 +17,10 @@ module HurriyetCli
|
|
17
17
|
|
18
18
|
private
|
19
19
|
def formated_parse(columns)
|
20
|
-
columns.each do |a|
|
21
|
-
created_at = Time.parse(a["CreatedDate"]).strftime("%d/%m/%y
|
22
|
-
@display.
|
20
|
+
columns.each.with_index(1) do |a, i|
|
21
|
+
created_at = Time.parse(a["CreatedDate"]).strftime("%d/%m/%y | %H:%M")
|
22
|
+
@display.print "#{i} - #{Rainbow(a["Title"]).red} - #{Rainbow(a["Fullname"]).orange} - #{Rainbow(created_at).color(:blue)} \n #{Rainbow(a["Description"]).color(:dimgray)} \n #{Rainbow(a["Url"]).cyan} \n"
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
26
|
-
end
|
26
|
+
end
|
data/lib/hurriyet_cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hurriyet_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ender Ahmet Yurt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|