sondakika 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +108 -0
  2. package/index.js +8 -3
  3. package/package.json +7 -3
package/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # Sondakika
2
+
3
+ Terminal-based CLI tool to fetch and display breaking news from RSS feeds.
4
+
5
+ ![sondakika](https://img.shields.io/badge/sondakika-news%20CLI-blue)
6
+ ![Node.js](https://img.shields.io/badge/Node.js-14%2B-green)
7
+ ![License](https://img.shields.io/badge/License-ISC-yellow)
8
+
9
+ ## Features
10
+
11
+ - 📰 Fetch news from multiple Turkish news sources
12
+ - 🔗 Clickable URLs in terminal (iTerm2, Windows Terminal, macOS Terminal)
13
+ - 🎨 Styled terminal output with Unicode borders
14
+ - ⚡ Fast and lightweight
15
+
16
+ ## Installation
17
+
18
+ ### Using npx (no install)
19
+
20
+ ```bash
21
+ npx sondakika ntv
22
+ ```
23
+
24
+ ### Global install
25
+
26
+ ```bash
27
+ npm install -g sondakika
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ```bash
33
+ # Show NTV news (default 10 items)
34
+ sondakika ntv
35
+
36
+ # Show 15 NTV news items
37
+ sondakika ntv 15
38
+
39
+ # Show Cumhuriyet news
40
+ sondakika cumhuriyet
41
+
42
+ # Show Cumhuriyet news with custom count
43
+ sondakika cumhuriyet 20
44
+
45
+ # Show TRT Haber news
46
+ sondakika trt
47
+
48
+ # Show TRT Haber news with custom count
49
+ sondakika trt 15
50
+
51
+ # Show Mynet news
52
+ sondakika mynet
53
+
54
+ # Show Mynet news with custom count
55
+ sondakika mynet 15
56
+ ```
57
+
58
+ ### Available Sources
59
+
60
+ | Command | Source |
61
+ |---------|--------|
62
+ | `ntv` | NTV Son Dakika |
63
+ | `cumhuriyet` | Cumhuriyet |
64
+ | `trt` | TRT Haber |
65
+ | `mynet` | Mynet |
66
+
67
+ ### Help
68
+
69
+ ```bash
70
+ sondakika
71
+ # or
72
+ sondakika --help
73
+ ```
74
+
75
+ ## Output Example
76
+
77
+ ```
78
+ 📰 ══════════════════════════════════════════════════
79
+ Latest 10 News from NTV
80
+ ══════════════════════════════════════════════════
81
+
82
+ ┌─ 1. Son dakika deprem mi oldu?
83
+
84
+ │ Son depremler...
85
+ └─────────────────────────────────────────────────────────────────────
86
+ 🔗 https://www.ntv.com.tr/...
87
+ ```
88
+
89
+ ## Development
90
+
91
+ ```bash
92
+ # Clone and install
93
+ npm install
94
+
95
+ # Run locally
96
+ npm start
97
+
98
+ # Link for global testing
99
+ npm link
100
+ ```
101
+
102
+ ## License
103
+
104
+ ISC
105
+
106
+ ## Author
107
+
108
+ Sedat ERGOZ
package/index.js CHANGED
@@ -3,7 +3,10 @@
3
3
  const Parser = require('rss-parser');
4
4
 
5
5
  const sources = {
6
- ntv: 'https://www.ntv.com.tr/son-dakika.rss'
6
+ ntv: 'https://www.ntv.com.tr/son-dakika.rss',
7
+ cumhuriyet: 'http://www.cumhuriyet.com.tr/rss/son_dakika.xml',
8
+ trt: 'https://www.trthaber.com/sondakika.rss',
9
+ mynet: 'https://www.mynet.com/haber/rss/sondakika'
7
10
  };
8
11
 
9
12
  const parser = new Parser();
@@ -76,6 +79,8 @@ async function fetchNews(source, count) {
76
79
  separator();
77
80
  console.log();
78
81
  });
82
+
83
+ process.exit(0);
79
84
  } catch (err) {
80
85
  console.error('Error fetching news:', err.message);
81
86
  process.exit(1);
@@ -85,9 +90,9 @@ async function fetchNews(source, count) {
85
90
  const args = process.argv.slice(2);
86
91
 
87
92
  if (args.length === 0) {
88
- console.log('Usage: news <source> [count]');
93
+ console.log('Usage: sondakika <source> [count]');
89
94
  console.log(`Available sources: ${Object.keys(sources).join(', ')}`);
90
- console.log('Example: news ntv 15');
95
+ console.log('Example: sondakika ntv 15');
91
96
  process.exit(1);
92
97
  }
93
98
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "sondakika",
3
- "version": "1.0.0",
4
- "description": "CLI to display breaking news from RSS feeds",
3
+ "version": "1.0.2",
4
+ "description": "Farkli kanallarin son dakika haberlerine komut satiri uzerinden kolayca ulasin.",
5
5
  "main": "index.js",
6
6
  "bin": {
7
- "news": "index.js"
7
+ "sondakika": "index.js"
8
8
  },
9
9
  "scripts": {
10
10
  "start": "node index.js"
@@ -14,6 +14,10 @@
14
14
  "rss",
15
15
  "cli"
16
16
  ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/eaeoz/sondakika.git"
20
+ },
17
21
  "author": "Sedat ERGOZ",
18
22
  "license": "ISC",
19
23
  "dependencies": {