-
-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathinternational-sources.ts
More file actions
1339 lines (1246 loc) · 40.8 KB
/
Copy pathinternational-sources.ts
File metadata and controls
1339 lines (1246 loc) · 40.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* @copyright 2024-2026 nirholas. All rights reserved.
* @license SPDX-License-Identifier: SEE LICENSE IN LICENSE
* @see https://github.com/nirholas/free-crypto-news
*
* This file is part of free-crypto-news.
* Unauthorized copying, modification, or distribution is strictly prohibited.
* For licensing inquiries: nirholas@users.noreply.github.com
*/
/**
* International Crypto News Sources
*
* Aggregates news from 75 international crypto news sources across 18 languages:
* - Korean (ko): 9 sources - Block Media, TokenPost, CoinDesk Korea, Decenter, Cobak, The B.Chain, Upbit Blog, Blockchain Today Korea, CryptoQuant Blog
* - Chinese (zh): 10 sources - 8BTC, Jinse Finance, Odaily, ChainNews, PANews, TechFlow, Foresight News, BlockBeats, MarsBit, Wu Blockchain
* - Japanese (ja): 6 sources - CoinPost, CoinDesk Japan, Cointelegraph Japan, btcnews.jp, Crypto Times Japan, CoinJinja
* - Spanish (es): 5 sources - Cointelegraph Español, Diario Bitcoin, CriptoNoticias, BeInCrypto Español, Bitcoiner Today
* - Portuguese (pt): 5 sources - Cointelegraph Brasil, Livecoins, Portal do Bitcoin, BeInCrypto Brasil, Bitcoin Block
* - German (de): 4 sources - BTC-ECHO, Cointelegraph Deutsch, Coincierge, CryptoMonday
* - French (fr): 4 sources - Journal du Coin, Cryptonaute, Cointelegraph France, Cryptoast
* - Russian (ru): 3 sources - ForkLog, Cointelegraph Russia, Bits.Media
* - Turkish (tr): 3 sources - Cointelegraph Türkçe, Koin Medya, Coinsider
* - Italian (it): 3 sources - Cointelegraph Italia, The Cryptonomist, Criptovalute.it
* - Indonesian (id): 3 sources - Cointelegraph Indonesia, Blockchain Media, Pintu Academy
* - Dutch (nl): 2 sources - Bitcoin Magazine NL, Crypto Insiders
* - Polish (pl): 2 sources - Kryptowaluty.pl, Bitcoin.pl
* - Vietnamese (vi): 2 sources - Tạp chí Bitcoin, Coin68
* - Thai (th): 2 sources - Siam Blockchain, Bitcoin Addict Thailand
* - Arabic (ar): 2 sources - Cointelegraph Arabic, ArabiCrypto
* - Hindi (hi): 5 sources - CoinSwitch, CoinDCX, WazirX, ZebPay, Crypto News India
* - Persian/Farsi (fa): 4 sources - Arz Digital, Mihan Blockchain, Ramz Arz, Nobitex
*
* Supports automatic translation to English via the source-translator module.
*/
import sanitizeHtml from 'sanitize-html';
import { newsCache, withCache } from './cache';
// ═══════════════════════════════════════════════════════════════
// TYPE DEFINITIONS
// ═══════════════════════════════════════════════════════════════
export interface InternationalSource {
key: string;
name: string;
url: string;
rss: string;
language: 'ko' | 'zh' | 'ja' | 'es' | 'pt' | 'de' | 'fr' | 'ru' | 'tr' | 'it' | 'id' | 'nl' | 'pl' | 'vi' | 'th' | 'ar' | 'hi' | 'fa';
category: string;
region: 'asia' | 'europe' | 'latam' | 'mena' | 'sea';
encoding?: string;
}
export interface InternationalArticle {
id: string;
title: string;
titleEnglish?: string;
description: string;
descriptionEnglish?: string;
link: string;
source: string;
sourceKey: string;
language: string;
pubDate: string;
category: string;
region: 'asia' | 'europe' | 'latam' | 'mena' | 'sea';
timeAgo: string;
}
export interface InternationalNewsResponse {
articles: InternationalArticle[];
total: number;
languages: string[];
regions: string[];
translated: boolean;
}
// ═══════════════════════════════════════════════════════════════
// SOURCE DEFINITIONS
// ═══════════════════════════════════════════════════════════════
const KOREAN_SOURCES: InternationalSource[] = [
{
key: 'blockmedia',
name: 'Block Media',
url: 'https://www.blockmedia.co.kr',
rss: 'https://www.blockmedia.co.kr/feed/',
language: 'ko',
category: 'general',
region: 'asia',
},
{
key: 'tokenpost',
name: 'TokenPost',
url: 'https://www.tokenpost.kr',
rss: 'https://www.tokenpost.kr/rss',
language: 'ko',
category: 'general',
region: 'asia',
},
{
key: 'coindeskkorea',
name: 'CoinDesk Korea',
url: 'https://www.coindeskkorea.com',
rss: 'https://www.coindeskkorea.com/feed/',
language: 'ko',
category: 'general',
region: 'asia',
},
{
key: 'blockchaintoday_ko',
name: 'Blockchain Today Korea',
url: 'https://www.blockchaintoday.co.kr',
rss: 'https://www.blockchaintoday.co.kr/rss/',
language: 'ko',
category: 'general',
region: 'asia',
},
{
key: 'decenter',
name: 'Decenter',
url: 'https://decenter.kr',
rss: 'https://decenter.kr/rss/allArticle.xml',
language: 'ko',
category: 'general',
region: 'asia',
},
{
key: 'thebchain',
name: 'The B.Chain',
url: 'https://www.thebchain.co.kr',
rss: 'https://www.thebchain.co.kr/rss/',
language: 'ko',
category: 'general',
region: 'asia',
},
{
key: 'cryptoquant_blog',
name: 'CryptoQuant Blog',
url: 'https://cryptoquant.com/blog',
rss: 'https://cryptoquant.com/blog/feed/',
language: 'ko',
category: 'analysis',
region: 'asia',
},
{
key: 'cobak',
name: 'Cobak',
url: 'https://cobak.co.kr',
rss: 'https://cobak.co.kr/feed/',
language: 'ko',
category: 'general',
region: 'asia',
},
{
key: 'upbit_blog',
name: 'Upbit Blog',
url: 'https://upbit.com/service_center/notice',
rss: 'https://upbit.com/service_center/notice/feed/',
language: 'ko',
category: 'exchange',
region: 'asia',
},
];
const CHINESE_SOURCES: InternationalSource[] = [
{
key: '8btc',
name: '8BTC (巴比特)',
url: 'https://www.8btc.com',
rss: 'https://www.8btc.com/feed',
language: 'zh',
category: 'general',
region: 'asia',
encoding: 'UTF-8',
},
{
key: 'jinse',
name: 'Jinse Finance (金色财经)',
url: 'https://www.jinse.com',
rss: 'https://www.jinse.com/rss',
language: 'zh',
category: 'general',
region: 'asia',
},
{
key: 'odaily',
name: 'Odaily (星球日报)',
url: 'https://www.odaily.news',
rss: 'https://www.odaily.news/rss',
language: 'zh',
category: 'general',
region: 'asia',
},
{
key: 'chainnews',
name: 'ChainNews (链闻)',
url: 'https://www.chainnews.com',
rss: 'https://www.chainnews.com/rss',
language: 'zh',
category: 'general',
region: 'asia',
},
{
key: 'panewslab',
name: 'PANews (PA财经)',
url: 'https://www.panewslab.com',
rss: 'https://www.panewslab.com/rss',
language: 'zh',
category: 'general',
region: 'asia',
},
{
key: 'techflow',
name: 'TechFlow (深潮)',
url: 'https://www.techflowpost.com',
rss: 'https://www.techflowpost.com/rss',
language: 'zh',
category: 'general',
region: 'asia',
},
{
key: 'foresightnews',
name: 'Foresight News',
url: 'https://foresightnews.pro',
rss: 'https://foresightnews.pro/rss',
language: 'zh',
category: 'general',
region: 'asia',
},
{
key: 'blockbeats',
name: 'BlockBeats (律动)',
url: 'https://www.theblockbeats.info',
rss: 'https://www.theblockbeats.info/rss',
language: 'zh',
category: 'general',
region: 'asia',
},
{
key: 'marsbit',
name: 'MarsBit (火星财经)',
url: 'https://news.marsbit.co',
rss: 'https://news.marsbit.co/rss',
language: 'zh',
category: 'general',
region: 'asia',
},
{
key: 'wublockchain',
name: 'Wu Blockchain',
url: 'https://wublock.substack.com',
rss: 'https://wublock.substack.com/feed',
language: 'zh',
category: 'analysis',
region: 'asia',
},
];
const JAPANESE_SOURCES: InternationalSource[] = [
{
key: 'coinpost',
name: 'CoinPost',
url: 'https://coinpost.jp',
rss: 'https://coinpost.jp/rss',
language: 'ja',
category: 'general',
region: 'asia',
},
{
key: 'coindeskjapan',
name: 'CoinDesk Japan',
url: 'https://www.coindeskjapan.com',
rss: 'https://www.coindeskjapan.com/feed/',
language: 'ja',
category: 'general',
region: 'asia',
},
{
key: 'cointelegraphjp',
name: 'Cointelegraph Japan',
url: 'https://jp.cointelegraph.com',
rss: 'https://jp.cointelegraph.com/rss',
language: 'ja',
category: 'general',
region: 'asia',
},
{
key: 'btcnewsjp',
name: 'btcnews.jp',
url: 'https://btcnews.jp',
rss: 'https://btcnews.jp/feed/',
language: 'ja',
category: 'general',
region: 'asia',
},
{
key: 'crypto_times_jp',
name: 'Crypto Times Japan',
url: 'https://crypto-times.jp',
rss: 'https://crypto-times.jp/feed/',
language: 'ja',
category: 'general',
region: 'asia',
},
{
key: 'coinjinja',
name: 'CoinJinja',
url: 'https://www.coinjinja.com',
rss: 'https://www.coinjinja.com/feed/',
language: 'ja',
category: 'general',
region: 'asia',
},
];
const SPANISH_SOURCES: InternationalSource[] = [
{
key: 'cointelegraphes',
name: 'Cointelegraph Español',
url: 'https://es.cointelegraph.com',
rss: 'https://es.cointelegraph.com/rss',
language: 'es',
category: 'general',
region: 'latam',
},
{
key: 'diariobitcoin',
name: 'Diario Bitcoin',
url: 'https://www.diariobitcoin.com',
rss: 'https://www.diariobitcoin.com/feed/',
language: 'es',
category: 'general',
region: 'latam',
},
{
key: 'criptonoticias',
name: 'CriptoNoticias',
url: 'https://www.criptonoticias.com',
rss: 'https://www.criptonoticias.com/feed/',
language: 'es',
category: 'general',
region: 'latam',
},
{
key: 'beincryptoes',
name: 'BeInCrypto Español',
url: 'https://es.beincrypto.com',
rss: 'https://es.beincrypto.com/feed/',
language: 'es',
category: 'general',
region: 'latam',
},
{
key: 'bitcoinertoday',
name: 'Bitcoiner Today',
url: 'https://bitcoinertoday.com',
rss: 'https://bitcoinertoday.com/feed/',
language: 'es',
category: 'general',
region: 'latam',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: PORTUGUESE SOURCES (Brazil & Portugal)
// ═══════════════════════════════════════════════════════════════
const PORTUGUESE_SOURCES: InternationalSource[] = [
{
key: 'cointelegraphbr',
name: 'Cointelegraph Brasil',
url: 'https://br.cointelegraph.com',
rss: 'https://br.cointelegraph.com/rss',
language: 'pt',
category: 'general',
region: 'latam',
},
{
key: 'livecoins',
name: 'Livecoins',
url: 'https://livecoins.com.br',
rss: 'https://livecoins.com.br/feed/',
language: 'pt',
category: 'general',
region: 'latam',
},
{
key: 'portaldobitcoin',
name: 'Portal do Bitcoin',
url: 'https://portaldobitcoin.uol.com.br',
rss: 'https://portaldobitcoin.uol.com.br/feed/',
language: 'pt',
category: 'general',
region: 'latam',
},
{
key: 'beincryptopr',
name: 'BeInCrypto Brasil',
url: 'https://br.beincrypto.com',
rss: 'https://br.beincrypto.com/feed/',
language: 'pt',
category: 'general',
region: 'latam',
},
{
key: 'bitcoinblock',
name: 'Bitcoin Block',
url: 'https://bitcoinblock.com.br',
rss: 'https://bitcoinblock.com.br/feed/',
language: 'pt',
category: 'bitcoin',
region: 'latam',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: GERMAN SOURCES
// ═══════════════════════════════════════════════════════════════
const GERMAN_SOURCES: InternationalSource[] = [
{
key: 'btcecho',
name: 'BTC-ECHO',
url: 'https://www.btc-echo.de',
rss: 'https://www.btc-echo.de/feed/',
language: 'de',
category: 'general',
region: 'europe',
},
{
key: 'cointelegraphde',
name: 'Cointelegraph Deutsch',
url: 'https://de.cointelegraph.com',
rss: 'https://de.cointelegraph.com/rss',
language: 'de',
category: 'general',
region: 'europe',
},
{
key: 'coincierge',
name: 'Coincierge',
url: 'https://coincierge.de',
rss: 'https://coincierge.de/feed/',
language: 'de',
category: 'general',
region: 'europe',
},
{
key: 'cryptomonday',
name: 'CryptoMonday',
url: 'https://cryptomonday.de',
rss: 'https://cryptomonday.de/feed/',
language: 'de',
category: 'general',
region: 'europe',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: FRENCH SOURCES
// ═══════════════════════════════════════════════════════════════
const FRENCH_SOURCES: InternationalSource[] = [
{
key: 'journalducoin',
name: 'Journal du Coin',
url: 'https://journalducoin.com',
rss: 'https://journalducoin.com/feed/',
language: 'fr',
category: 'general',
region: 'europe',
},
{
key: 'cryptonaute',
name: 'Cryptonaute',
url: 'https://cryptonaute.fr',
rss: 'https://cryptonaute.fr/feed/',
language: 'fr',
category: 'general',
region: 'europe',
},
{
key: 'cointelegraphfr',
name: 'Cointelegraph France',
url: 'https://fr.cointelegraph.com',
rss: 'https://fr.cointelegraph.com/rss',
language: 'fr',
category: 'general',
region: 'europe',
},
{
key: 'cryptoast',
name: 'Cryptoast',
url: 'https://cryptoast.fr',
rss: 'https://cryptoast.fr/feed/',
language: 'fr',
category: 'general',
region: 'europe',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: RUSSIAN SOURCES
// ═══════════════════════════════════════════════════════════════
const RUSSIAN_SOURCES: InternationalSource[] = [
{
key: 'forklog',
name: 'ForkLog',
url: 'https://forklog.com',
rss: 'https://forklog.com/feed/',
language: 'ru',
category: 'general',
region: 'europe',
},
{
key: 'cointelegraphru',
name: 'Cointelegraph Russia',
url: 'https://ru.cointelegraph.com',
rss: 'https://ru.cointelegraph.com/rss',
language: 'ru',
category: 'general',
region: 'europe',
},
{
key: 'bits_media',
name: 'Bits.Media',
url: 'https://bits.media',
rss: 'https://bits.media/rss/',
language: 'ru',
category: 'general',
region: 'europe',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: TURKISH SOURCES
// ═══════════════════════════════════════════════════════════════
const TURKISH_SOURCES: InternationalSource[] = [
{
key: 'cointelegraphtr',
name: 'Cointelegraph Türkçe',
url: 'https://tr.cointelegraph.com',
rss: 'https://tr.cointelegraph.com/rss',
language: 'tr',
category: 'general',
region: 'europe',
},
{
key: 'koinmedya',
name: 'Koin Medya',
url: 'https://koinmedya.com',
rss: 'https://koinmedya.com/feed/',
language: 'tr',
category: 'general',
region: 'europe',
},
{
key: 'coinsider',
name: 'Coinsider',
url: 'https://coinsider.com.tr',
rss: 'https://coinsider.com.tr/feed/',
language: 'tr',
category: 'general',
region: 'europe',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: ITALIAN SOURCES
// ═══════════════════════════════════════════════════════════════
const ITALIAN_SOURCES: InternationalSource[] = [
{
key: 'cointelegraphit',
name: 'Cointelegraph Italia',
url: 'https://it.cointelegraph.com',
rss: 'https://it.cointelegraph.com/rss',
language: 'it',
category: 'general',
region: 'europe',
},
{
key: 'cryptonomist',
name: 'The Cryptonomist',
url: 'https://it.cryptonomist.ch',
rss: 'https://it.cryptonomist.ch/feed/',
language: 'it',
category: 'general',
region: 'europe',
},
{
key: 'criptovaluteit',
name: 'Criptovalute.it',
url: 'https://www.criptovalute.it',
rss: 'https://www.criptovalute.it/feed/',
language: 'it',
category: 'general',
region: 'europe',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: INDONESIAN SOURCES
// ═══════════════════════════════════════════════════════════════
const INDONESIAN_SOURCES: InternationalSource[] = [
{
key: 'cointelegraphid',
name: 'Cointelegraph Indonesia',
url: 'https://id.cointelegraph.com',
rss: 'https://id.cointelegraph.com/rss',
language: 'id',
category: 'general',
region: 'asia',
},
{
key: 'blockchainmedia',
name: 'Blockchain Media',
url: 'https://blockchainmedia.id',
rss: 'https://blockchainmedia.id/feed/',
language: 'id',
category: 'general',
region: 'asia',
},
{
key: 'pintu_academy',
name: 'Pintu Academy',
url: 'https://pintu.co.id/academy',
rss: 'https://pintu.co.id/academy/feed/',
language: 'id',
category: 'education',
region: 'asia',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: DUTCH SOURCES
// ═══════════════════════════════════════════════════════════════
const DUTCH_SOURCES: InternationalSource[] = [
{
key: 'bitcoinmagazine_nl',
name: 'Bitcoin Magazine NL',
url: 'https://bitcoinmagazine.nl',
rss: 'https://bitcoinmagazine.nl/feed/',
language: 'nl',
category: 'bitcoin',
region: 'europe',
},
{
key: 'crypto_insiders',
name: 'Crypto Insiders',
url: 'https://www.crypto-insiders.nl',
rss: 'https://www.crypto-insiders.nl/feed/',
language: 'nl',
category: 'general',
region: 'europe',
},
{
key: 'blox_nl',
name: 'Blox',
url: 'https://blox.nl',
rss: 'https://blox.nl/nieuws/feed/',
language: 'nl',
category: 'general',
region: 'europe',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: POLISH SOURCES
// ═══════════════════════════════════════════════════════════════
const POLISH_SOURCES: InternationalSource[] = [
{
key: 'kryptowaluty',
name: 'Kryptowaluty.pl',
url: 'https://kryptowaluty.pl',
rss: 'https://kryptowaluty.pl/feed/',
language: 'pl',
category: 'general',
region: 'europe',
},
{
key: 'bitcoin_pl',
name: 'Bitcoin.pl',
url: 'https://bitcoin.pl',
rss: 'https://bitcoin.pl/feed/',
language: 'pl',
category: 'bitcoin',
region: 'europe',
},
{
key: 'comparic',
name: 'Comparic',
url: 'https://comparic.pl',
rss: 'https://comparic.pl/feed/',
language: 'pl',
category: 'trading',
region: 'europe',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: VIETNAMESE SOURCES
// ═══════════════════════════════════════════════════════════════
const VIETNAMESE_SOURCES: InternationalSource[] = [
{
key: 'tapchibitcoin',
name: 'Tạp chí Bitcoin',
url: 'https://tapchibitcoin.io',
rss: 'https://tapchibitcoin.io/feed/',
language: 'vi',
category: 'general',
region: 'asia',
},
{
key: 'coin68',
name: 'Coin68',
url: 'https://coin68.com',
rss: 'https://coin68.com/feed/',
language: 'vi',
category: 'general',
region: 'asia',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: THAI SOURCES
// ═══════════════════════════════════════════════════════════════
const THAI_SOURCES: InternationalSource[] = [
{
key: 'siamblockchain',
name: 'Siam Blockchain',
url: 'https://siamblockchain.com',
rss: 'https://siamblockchain.com/feed/',
language: 'th',
category: 'general',
region: 'asia',
},
{
key: 'bitcoinaddictth',
name: 'Bitcoin Addict Thailand',
url: 'https://bitcoinaddict.org',
rss: 'https://bitcoinaddict.org/feed/',
language: 'th',
category: 'general',
region: 'asia',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: ARABIC SOURCES
// ═══════════════════════════════════════════════════════════════
const ARABIC_SOURCES: InternationalSource[] = [
{
key: 'cointelegraphar',
name: 'Cointelegraph Arabic',
url: 'https://ar.cointelegraph.com',
rss: 'https://ar.cointelegraph.com/rss',
language: 'ar',
category: 'general',
region: 'mena',
},
{
key: 'arabicrypto',
name: 'ArabiCrypto',
url: 'https://arabicrypto.io',
rss: 'https://arabicrypto.io/feed/',
language: 'ar',
category: 'general',
region: 'mena',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: HINDI / INDIAN SOURCES
// ═══════════════════════════════════════════════════════════════
const HINDI_SOURCES: InternationalSource[] = [
{
key: 'coinswitch',
name: 'CoinSwitch Kuber Blog',
url: 'https://coinswitch.co/blog',
rss: 'https://coinswitch.co/blog/feed',
language: 'hi',
category: 'general',
region: 'asia',
},
{
key: 'coindcx',
name: 'CoinDCX Blog',
url: 'https://coindcx.com/blog',
rss: 'https://coindcx.com/blog/feed/',
language: 'hi',
category: 'general',
region: 'asia',
},
{
key: 'wazirx',
name: 'WazirX Blog',
url: 'https://wazirx.com/blog',
rss: 'https://wazirx.com/blog/feed/',
language: 'hi',
category: 'general',
region: 'asia',
},
{
key: 'zebpay',
name: 'ZebPay Blog',
url: 'https://zebpay.com/blog',
rss: 'https://zebpay.com/blog/feed/',
language: 'hi',
category: 'general',
region: 'asia',
},
{
key: 'cryptonewsindia',
name: 'Crypto News India',
url: 'https://cryptonewsindia.com',
rss: 'https://cryptonewsindia.com/feed/',
language: 'hi',
category: 'general',
region: 'asia',
},
];
// ═══════════════════════════════════════════════════════════════
// NEW: PERSIAN / FARSI SOURCES
// ═══════════════════════════════════════════════════════════════
const PERSIAN_SOURCES: InternationalSource[] = [
{
key: 'arzdigital',
name: 'Arz Digital (ارز دیجیتال)',
url: 'https://arzdigital.com',
rss: 'https://arzdigital.com/feed/',
language: 'fa',
category: 'general',
region: 'mena',
},
{
key: 'mihanblockchain',
name: 'Mihan Blockchain (میهن بلاکچین)',
url: 'https://mihanblockchain.com',
rss: 'https://mihanblockchain.com/feed/',
language: 'fa',
category: 'general',
region: 'mena',
},
{
key: 'ramzarz',
name: 'Ramz Arz (رمزارز)',
url: 'https://ramzarz.news',
rss: 'https://ramzarz.news/feed/',
language: 'fa',
category: 'general',
region: 'mena',
},
{
key: 'nobitex',
name: 'Nobitex Blog',
url: 'https://nobitex.ir/blog',
rss: 'https://nobitex.ir/blog/feed/',
language: 'fa',
category: 'general',
region: 'mena',
},
];
// All international sources combined
export const INTERNATIONAL_SOURCES: InternationalSource[] = [
...KOREAN_SOURCES,
...CHINESE_SOURCES,
...JAPANESE_SOURCES,
...SPANISH_SOURCES,
...PORTUGUESE_SOURCES,
...GERMAN_SOURCES,
...FRENCH_SOURCES,
...RUSSIAN_SOURCES,
...TURKISH_SOURCES,
...ITALIAN_SOURCES,
...INDONESIAN_SOURCES,
...DUTCH_SOURCES,
...POLISH_SOURCES,
...VIETNAMESE_SOURCES,
...THAI_SOURCES,
...ARABIC_SOURCES,
...HINDI_SOURCES,
...PERSIAN_SOURCES,
];
// Source lookup by language
export const SOURCES_BY_LANGUAGE: Record<string, InternationalSource[]> = {
ko: KOREAN_SOURCES,
zh: CHINESE_SOURCES,
ja: JAPANESE_SOURCES,
es: SPANISH_SOURCES,
pt: PORTUGUESE_SOURCES,
de: GERMAN_SOURCES,
fr: FRENCH_SOURCES,
ru: RUSSIAN_SOURCES,
tr: TURKISH_SOURCES,
it: ITALIAN_SOURCES,
id: INDONESIAN_SOURCES,
nl: DUTCH_SOURCES,
pl: POLISH_SOURCES,
vi: VIETNAMESE_SOURCES,
th: THAI_SOURCES,
ar: ARABIC_SOURCES,
hi: HINDI_SOURCES,
fa: PERSIAN_SOURCES,
};
// Source lookup by region
export const SOURCES_BY_REGION: Record<string, InternationalSource[]> = {
asia: [...KOREAN_SOURCES, ...CHINESE_SOURCES, ...JAPANESE_SOURCES, ...HINDI_SOURCES],
latam: [...SPANISH_SOURCES, ...PORTUGUESE_SOURCES],
europe: [...GERMAN_SOURCES, ...FRENCH_SOURCES, ...RUSSIAN_SOURCES, ...TURKISH_SOURCES, ...ITALIAN_SOURCES, ...DUTCH_SOURCES, ...POLISH_SOURCES],
mena: [...ARABIC_SOURCES, ...PERSIAN_SOURCES],
sea: [...INDONESIAN_SOURCES, ...VIETNAMESE_SOURCES, ...THAI_SOURCES],
};
// ═══════════════════════════════════════════════════════════════
// UTILITY FUNCTIONS
// ═══════════════════════════════════════════════════════════════
/**
* Generate a unique article ID from source and link
*/
function generateArticleId(sourceKey: string, link: string): string {
const hash = link
.split('')
.reduce((acc, char) => ((acc << 5) - acc + char.charCodeAt(0)) | 0, 0);
return `${sourceKey}-${Math.abs(hash).toString(36)}`;
}
/**
* Calculate human-readable time ago string
*/
function getTimeAgo(date: Date): string {
const now = new Date();
const diffMs = now.getTime() - date.getTime();
const diffMins = Math.floor(diffMs / 60000);
const diffHours = Math.floor(diffMins / 60);
const diffDays = Math.floor(diffHours / 24);
if (diffMins < 1) return 'just now';
if (diffMins < 60) return `${diffMins}m ago`;
if (diffHours < 24) return `${diffHours}h ago`;
if (diffDays === 1) return 'yesterday';
if (diffDays < 7) return `${diffDays}d ago`;
return date.toLocaleDateString();
}
/**
* Strip CDATA wrapper from a string if present
* e.g. <![CDATA[https://example.com]]> → https://example.com
*/
function stripCDATA(text: string): string {
const match = text.match(/^<!\[CDATA\[([\s\S]*?)\]\]>$/);
return match ? match[1].trim() : text;
}
/**
* Sanitize and truncate description
*/
function sanitizeDescription(raw: string): string {
if (!raw) return '';
const sanitized = sanitizeHtml(raw, {
allowedTags: [],
allowedAttributes: {},
});
return sanitized.trim().slice(0, 300);
}
/**
* Decode HTML entities in text
*/
function decodeHtmlEntities(text: string): string {
const entities: Record<string, string> = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
''': "'",
''': "'",
' ': ' ',
};
let decoded = text;
for (const [entity, char] of Object.entries(entities)) {
decoded = decoded.replace(new RegExp(entity, 'g'), char);
}
// Handle numeric entities
decoded = decoded.replace(/&#(\d+);/g, (_, code) => String.fromCharCode(parseInt(code, 10)));
decoded = decoded.replace(/&#x([0-9a-fA-F]+);/g, (_, code) => String.fromCharCode(parseInt(code, 16)));
return decoded;
}
// ═══════════════════════════════════════════════════════════════
// RSS PARSING
// ═══════════════════════════════════════════════════════════════