@@ -287,9 +287,14 @@ async function fetchWithTimeout(
287287 init ?: RequestInit ,
288288) : Promise < Response > {
289289 const controller = new AbortController ( ) ;
290- const timeout = setTimeout ( ( ) => controller . abort ( ) , 10_000 ) ;
290+ const timeout = setTimeout ( ( ) => controller . abort ( ) , 15_000 ) ;
291291 try {
292- return await fetch ( url , { ...init , signal : controller . signal } ) ;
292+ return await fetch ( url , {
293+ ...init ,
294+ signal : controller . signal ,
295+ // Next.js extends fetch() with aggressive caching — disable it
296+ cache : 'no-store' as RequestCache ,
297+ } ) ;
293298 } finally {
294299 clearTimeout ( timeout ) ;
295300 }
@@ -550,7 +555,10 @@ async function fetchDevto(lookbackDays: number): Promise<TrendSignal[]> {
550555 const res = await fetchWithTimeout (
551556 `https://dev.to/api/articles?tag=${ tag } &top=${ lookbackDays } ` ,
552557 ) ;
553- if ( ! res . ok ) return [ ] ;
558+ if ( ! res . ok ) {
559+ console . warn ( `${ LOG_PREFIX } Dev.to tag ${ tag } failed: ${ res . status } ` ) ;
560+ return [ ] ;
561+ }
554562 return ( await res . json ( ) ) as DevtoArticle [ ] ;
555563 } ) ,
556564 ) ;
@@ -613,6 +621,9 @@ async function fetchBlogFeeds(lookbackDays: number): Promise<TrendSignal[]> {
613621 }
614622 const xml = await res . text ( ) ;
615623 const items = parseFeedItems ( xml ) ;
624+ if ( items . length === 0 ) {
625+ console . warn ( `${ LOG_PREFIX } Blog feed ${ feed . name } : parsed 0 items from ${ xml . length } bytes` ) ;
626+ }
616627 return items . map ( ( item ) => ( { ...item , feedName : feed . name } ) ) ;
617628 } ) ,
618629 ) ;
@@ -776,9 +787,9 @@ function parseGitHubTrendingHTML(html: string, language: string): GitHubTrending
776787 . replace ( / < [ ^ > ] + > / g, "" )
777788 . trim ( ) ;
778789
779- // Stars today from "N stars today" text
790+ // Stars from "N stars today" or "N stars this week " text
780791 const starsMatch = block . match (
781- / ( \d [ \d , ] * ) \s + s t a r s ? \s + t o d a y / i,
792+ / ( \d [ \d , ] * ) \s + s t a r s ? \s + (?: t o d a y | t h i s \s + w e e k | t h i s \s + m o n t h ) / i,
782793 ) ;
783794 const starsToday = starsMatch
784795 ? parseInt ( starsMatch [ 1 ] . replace ( / , / g, "" ) , 10 )
0 commit comments