- Timestamp:
- Jul 30, 2022, 12:10:48 AM (2 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Global.php
r903 r938 382 382 return call_user_func_array('pack', array_merge(array($v), (array)$a)); 383 383 } 384 385 function file_get_contents_curl(string $Url) 386 { 387 $Ch = curl_init(); 388 389 curl_setopt($Ch, CURLOPT_AUTOREFERER, TRUE); 390 curl_setopt($Ch, CURLOPT_HEADER, 0); 391 curl_setopt($Ch, CURLOPT_RETURNTRANSFER, 1); 392 curl_setopt($Ch, CURLOPT_URL, $Url); 393 curl_setopt($Ch, CURLOPT_FOLLOWLOCATION, TRUE); 394 395 $Data = curl_exec($Ch); 396 curl_close($Ch); 397 return $Data; 398 } -
trunk/Modules/News/Import/Vismo.php
r887 r938 3 3 class NewsSourceVismo extends NewsSource 4 4 { 5 5 6 function Import(): string 6 7 { 7 8 $Output = parent::Import(); 8 $Content = file_get_contents ($this->URL);9 $Content = file_get_contents_curl($this->URL); 9 10 10 11 $BlockStart = '<h2 class="cvi text-to-speech">Přehled dokumentů</h2>'; … … 26 27 $NewsItem->Link = GetUrlBase($this->URL).html_entity_decode(GetTextBetween($Item, '<a href="', '">')); 27 28 $NewsItem->Title = html_entity_decode(GetTextBetween($Item, '', '</a>')); 28 $ NewsItem->Date = GetTextBetween($Item, '<span>(', ')</span>');29 $NewsItem->Date = HumanDateToTime($ NewsItem->Date);29 $Date = GetTextBetween($Item, '<span>(', ')</span>'); 30 $NewsItem->Date = HumanDateToTime($Date); 30 31 $NewsItem->Category = $this->Category; 31 32 if (strpos($Item, '<div>') !== false) -
trunk/Modules/News/News.php
r908 r938 4 4 include_once(dirname(__FILE__).'/NewsSource.php'); 5 5 include_once(dirname(__FILE__).'/Import/Vismo.php'); 6 include_once(dirname(__FILE__).'/Import/ZdechovNET.php'); 6 7 7 8 function CategoryItemCompare($Item1, $Item2) -
trunk/Modules/News/NewsSource.php
r887 r938 75 75 $Method = $DbRow['Method']; 76 76 if ($Method == 'vismo') $Source = new NewsSourceVismo(); 77 else if ($Method == 'zdechovnet') $Source = new NewsSourceZdechovNET(); 77 78 else { 78 79 $Output .= 'Unsupported parse method: '.$Method.'<br/>';
Note:
See TracChangeset
for help on using the changeset viewer.