sondakika 1.0.5 → 1.0.6
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.
- package/AGENTS.md +31 -5
- package/index.js +39 -3
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -7,7 +7,7 @@ This is a simple Node.js CLI application that fetches and displays news from RSS
|
|
|
7
7
|
## Project Structure
|
|
8
8
|
|
|
9
9
|
```
|
|
10
|
-
|
|
10
|
+
sondakika/
|
|
11
11
|
├── index.js # Main CLI entry point
|
|
12
12
|
├── package.json # Project dependencies and scripts
|
|
13
13
|
└── AGENTS.md # This file - guidelines for AI agents
|
|
@@ -23,10 +23,11 @@ node index.js # Direct execution
|
|
|
23
23
|
# With arguments
|
|
24
24
|
node index.js ntv # Show NTV news (default 10 items)
|
|
25
25
|
node index.js ntv 15 # Show 15 NTV news items
|
|
26
|
+
node index.js haberturk 5 # Show Habertürk 5 news
|
|
26
27
|
|
|
27
|
-
# Global installation (for '
|
|
28
|
+
# Global installation (for 'sondakika' command)
|
|
28
29
|
npm link
|
|
29
|
-
|
|
30
|
+
sondakika ntv 15 # Run as global command
|
|
30
31
|
```
|
|
31
32
|
|
|
32
33
|
## Adding New RSS Sources
|
|
@@ -36,8 +37,12 @@ To add a new news source, edit `index.js` and add to the `sources` object:
|
|
|
36
37
|
```javascript
|
|
37
38
|
const sources = {
|
|
38
39
|
ntv: 'https://www.ntv.com.tr/son-dakika.rss',
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
// ...
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const sourceInfo = {
|
|
44
|
+
ntv: { name: 'NTV', isSondakika: true }, // isSondakika: true for breaking news
|
|
45
|
+
// ...
|
|
41
46
|
};
|
|
42
47
|
```
|
|
43
48
|
|
|
@@ -46,6 +51,27 @@ Then run with:
|
|
|
46
51
|
node index.js bbc
|
|
47
52
|
```
|
|
48
53
|
|
|
54
|
+
## Available News Sources
|
|
55
|
+
|
|
56
|
+
### Son Dakika (Breaking News)
|
|
57
|
+
| Key | Name | Description |
|
|
58
|
+
|-----|------|-------------|
|
|
59
|
+
| ntv | NTV (Son Dakika) | NTV breaking news |
|
|
60
|
+
| cumhuriyet | Cumhuriyet | Cumhuriyet breaking news |
|
|
61
|
+
| trt | TRT Haber | TRT breaking news |
|
|
62
|
+
| mynet | Mynet | Mynet breaking news |
|
|
63
|
+
|
|
64
|
+
### General News
|
|
65
|
+
| Key | Name | Description |
|
|
66
|
+
|-----|------|-------------|
|
|
67
|
+
| sabah | Sabah | Sabah newspaper |
|
|
68
|
+
| star | Star | Star newspaper |
|
|
69
|
+
| vatan | Gazete Vatan | Vatan newspaper |
|
|
70
|
+
| haberturk | Habertürk | Habertürk news |
|
|
71
|
+
| cnnturk | CNN Türk | CNN Türk news |
|
|
72
|
+
| yenisafak | Yeni Şafak | Yeni Şafak newspaper |
|
|
73
|
+
| aa | Anadolu Ajansı | Anadolu Agency (English) |
|
|
74
|
+
|
|
49
75
|
## No Test/Lint Commands
|
|
50
76
|
|
|
51
77
|
This project does not currently have:
|
package/index.js
CHANGED
|
@@ -6,7 +6,28 @@ const sources = {
|
|
|
6
6
|
ntv: 'https://www.ntv.com.tr/son-dakika.rss',
|
|
7
7
|
cumhuriyet: 'http://www.cumhuriyet.com.tr/rss/son_dakika.xml',
|
|
8
8
|
trt: 'https://www.trthaber.com/sondakika.rss',
|
|
9
|
-
mynet: 'https://www.mynet.com/haber/rss/sondakika'
|
|
9
|
+
mynet: 'https://www.mynet.com/haber/rss/sondakika',
|
|
10
|
+
sabah: 'https://www.sabah.com.tr/rss/anasayfa.xml',
|
|
11
|
+
star: 'https://www.star.com.tr/rss/rss.asp?cid=124',
|
|
12
|
+
vatan: 'https://www.gazetevatan.com/rss/gundem.xml',
|
|
13
|
+
haberturk: 'https://www.haberturk.com/rss',
|
|
14
|
+
cnnturk: 'https://cnnturk.com/feed/rss/turkiye',
|
|
15
|
+
yenisafak: 'https://www.yenisafak.com/rss',
|
|
16
|
+
aa: 'https://www.aa.com.tr/en/rss'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const sourceInfo = {
|
|
20
|
+
ntv: { name: 'NTV', isSondakika: true },
|
|
21
|
+
cumhuriyet: { name: 'Cumhuriyet', isSondakika: true },
|
|
22
|
+
trt: { name: 'TRT Haber', isSondakika: true },
|
|
23
|
+
mynet: { name: 'Mynet', isSondakika: true },
|
|
24
|
+
sabah: { name: 'Sabah', isSondakika: false },
|
|
25
|
+
star: { name: 'Star', isSondakika: false },
|
|
26
|
+
vatan: { name: 'Gazete Vatan', isSondakika: false },
|
|
27
|
+
haberturk: { name: 'Habertürk', isSondakika: false },
|
|
28
|
+
cnnturk: { name: 'CNN Türk', isSondakika: false },
|
|
29
|
+
yenisafak: { name: 'Yeni Şafak', isSondakika: false },
|
|
30
|
+
aa: { name: 'Anadolu Ajansı', isSondakika: false }
|
|
10
31
|
};
|
|
11
32
|
|
|
12
33
|
const parser = new Parser();
|
|
@@ -52,8 +73,12 @@ async function fetchNews(source, count) {
|
|
|
52
73
|
}
|
|
53
74
|
}
|
|
54
75
|
|
|
76
|
+
const sourceKey = source.toLowerCase();
|
|
77
|
+
const info = sourceInfo[sourceKey] || { name: source.toUpperCase(), isSondakika: false };
|
|
78
|
+
const sourceName = info.isSondakika ? `${info.name} (Son Dakika)` : info.name;
|
|
79
|
+
|
|
55
80
|
console.log('\n📰 ' + '═'.repeat(50));
|
|
56
|
-
console.log(` Latest ${items.length} News from ${
|
|
81
|
+
console.log(` Latest ${items.length} News from ${sourceName}`);
|
|
57
82
|
if (latestUpdate) {
|
|
58
83
|
console.log(` Son guncelleme: ${latestUpdate}`);
|
|
59
84
|
}
|
|
@@ -125,17 +150,28 @@ if (args.length === 0 || args[0] === '--help') {
|
|
|
125
150
|
Usage:
|
|
126
151
|
sondakika <source> [count]
|
|
127
152
|
|
|
128
|
-
Sources:
|
|
153
|
+
Sources (Son Dakika):
|
|
129
154
|
ntv NTV Son Dakika
|
|
130
155
|
cumhuriyet Cumhuriyet
|
|
131
156
|
trt TRT Haber
|
|
132
157
|
mynet Mynet
|
|
133
158
|
|
|
159
|
+
Sources (Haberler):
|
|
160
|
+
sabah Sabah
|
|
161
|
+
star Star
|
|
162
|
+
vatan Gazete Vatan
|
|
163
|
+
haberturk Habertürk
|
|
164
|
+
cnnturk CNN Türk
|
|
165
|
+
yenisafak Yeni Şafak
|
|
166
|
+
aa Anadolu Ajansı
|
|
167
|
+
|
|
134
168
|
Examples:
|
|
135
169
|
sondakika ntv # NTV haberleri (varsayilan 10 adet)
|
|
136
170
|
sondakika ntv 15 # NTV 15 haber
|
|
137
171
|
sondakika trt # TRT Haber
|
|
138
172
|
sondakika mynet 5 # Mynet 5 haber
|
|
173
|
+
sondakika sabah # Sabah haberleri
|
|
174
|
+
sondakika haberturk 5 # Habertürk 5 haber
|
|
139
175
|
`);
|
|
140
176
|
process.exit(0);
|
|
141
177
|
}
|