sondakika 1.0.3 → 1.0.5

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 +2 -0
  2. package/index.js +31 -2
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -81,6 +81,8 @@ sondakika --help
81
81
 
82
82
  ┌─ 1. Son dakika deprem mi oldu?
83
83
 
84
+ │ 📅 10.04.2026 20:02
85
+
84
86
  │ Son depremler...
85
87
  └─────────────────────────────────────────────────────────────────────
86
88
  🔗 https://www.ntv.com.tr/...
package/index.js CHANGED
@@ -42,21 +42,45 @@ async function fetchNews(source, count) {
42
42
  const feed = await parser.parseURL(url);
43
43
  const items = feed.items.slice(0, count);
44
44
 
45
+ const firstItem = feed.items[0];
46
+ let latestUpdate = '';
47
+ if (firstItem && (firstItem.pubDate || firstItem.isodate)) {
48
+ const date = new Date(firstItem.pubDate || firstItem.isodate);
49
+ if (!isNaN(date.getTime())) {
50
+ const options = { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' };
51
+ latestUpdate = date.toLocaleDateString('tr-TR', options);
52
+ }
53
+ }
54
+
45
55
  console.log('\n📰 ' + '═'.repeat(50));
46
56
  console.log(` Latest ${items.length} News from ${source.toUpperCase()}`);
57
+ if (latestUpdate) {
58
+ console.log(` Son guncelleme: ${latestUpdate}`);
59
+ }
47
60
  console.log(' ' + '═'.repeat(50) + '\n');
48
61
 
49
62
  items.forEach((item, index) => {
50
63
  const title = item.title;
51
64
  const summary = item.summary || item.contentSnippet || '';
52
65
  const link = item.link;
66
+ const pubDate = item.pubDate || item.isodate;
53
67
 
54
- const titleLines = wrapText(title, 68);
55
- const summaryLines = wrapText(summary, 68);
68
+ let dateStr = '';
69
+ if (pubDate) {
70
+ const date = new Date(pubDate);
71
+ if (!isNaN(date.getTime())) {
72
+ const options = { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' };
73
+ dateStr = date.toLocaleDateString('tr-TR', options);
74
+ }
75
+ }
76
+
77
+ const titleLines = wrapText(title, 60);
78
+ const summaryLines = wrapText(summary, 60);
56
79
 
57
80
  const maxWidth = Math.max(
58
81
  ...titleLines.map(l => l.length),
59
82
  ...summaryLines.map(l => l.length),
83
+ dateStr.length,
60
84
  3
61
85
  );
62
86
 
@@ -69,6 +93,11 @@ async function fetchNews(source, count) {
69
93
  });
70
94
  console.log(` │`);
71
95
 
96
+ if (dateStr) {
97
+ console.log(` │ 📅 ${dateStr}`);
98
+ console.log(` │`);
99
+ }
100
+
72
101
  summaryLines.forEach(line => {
73
102
  console.log(` │ ${line}`);
74
103
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sondakika",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Farkli kanallarin son dakika haberlerine komut satiri uzerinden kolayca ulasin.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -10,9 +10,9 @@
10
10
  "start": "node index.js"
11
11
  },
12
12
  "keywords": [
13
- "news",
14
- "rss",
15
- "cli"
13
+ "sondakika",
14
+ "haberler",
15
+ "haber"
16
16
  ],
17
17
  "repository": {
18
18
  "type": "git",