Neu: Winaero Tweaker Updates Bridge
This commit is contained in:
@@ -291,6 +291,13 @@ Diese Sammlung enthält verschiedene Bridge-Implementierungen für RSS-Bridge, u
|
||||
- Automatische Deduplizierung von Artikeln
|
||||
- Limitiert auf die 10 neuesten Artikel
|
||||
|
||||
### [Winaero Tweaker Updates Bridge](https://bridge.ponywave.de/#bridge-WinaeroTweakerBridge) (Von Akamaru)
|
||||
- **Beschreibung**: Zeigt die neuesten Updates für die Winaero Tweaker Anwendung
|
||||
- **Hinweise**:
|
||||
- Extrahiert vollständigen Content inklusive Bilder
|
||||
- Zeigt bis zu 10 neueste Updates
|
||||
- Datum und Autor werden automatisch extrahiert
|
||||
|
||||
### [xHamster User Bridge](https://bridge.ponywave.de/#bridge-XHamsterUserBridge) (Von Akamaru)
|
||||
- **Beschreibung**: Zeigt die neuesten Videos eines xHamster Users
|
||||
- **Parameter**:
|
||||
|
||||
80
WinaeroTweakerBridge.php
Normal file
80
WinaeroTweakerBridge.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
class WinaeroTweakerBridge extends BridgeAbstract
|
||||
{
|
||||
const MAINTAINER = 'Akamaru';
|
||||
const NAME = 'Winaero Tweaker Updates';
|
||||
const URI = 'https://winaero.com/category/winaero-apps/winaero-tweaker/';
|
||||
const CACHE_TIMEOUT = 21600; // 6 hours
|
||||
const DESCRIPTION = 'Returns updates for Winaero Tweaker application';
|
||||
|
||||
public function getIcon()
|
||||
{
|
||||
return 'https://www.google.com/s2/favicons?domain=winaero.com&sz=32';
|
||||
}
|
||||
|
||||
public function collectData()
|
||||
{
|
||||
$html = getSimpleHTMLDOM(self::URI)
|
||||
or returnServerError('Could not fetch Winaero Tweaker category page');
|
||||
|
||||
// Find all article elements
|
||||
$articles = $html->find('article');
|
||||
|
||||
$itemCount = 0;
|
||||
$maxItems = 10; // Limit to first page (approximately 10 items)
|
||||
|
||||
foreach ($articles as $article) {
|
||||
if ($itemCount >= $maxItems) {
|
||||
break;
|
||||
}
|
||||
|
||||
$item = [];
|
||||
|
||||
// Extract title and link from header
|
||||
$header = $article->find('.entry-header', 0);
|
||||
if ($header) {
|
||||
$titleLink = $header->find('h2 a', 0);
|
||||
if ($titleLink) {
|
||||
$item['title'] = trim($titleLink->plaintext);
|
||||
$item['uri'] = $titleLink->href;
|
||||
$item['uid'] = $titleLink->href;
|
||||
}
|
||||
}
|
||||
|
||||
// Extract content from entry-content div
|
||||
$contentDiv = $article->find('.entry-content', 0);
|
||||
if ($contentDiv) {
|
||||
// Get the full HTML content including images
|
||||
$item['content'] = $contentDiv->innertext;
|
||||
}
|
||||
|
||||
// Extract date and author from footer
|
||||
$footer = $article->find('.entry-footer', 0);
|
||||
if ($footer) {
|
||||
// Extract date from time element
|
||||
$timeElement = $footer->find('time.entry-date', 0);
|
||||
if ($timeElement && $timeElement->datetime) {
|
||||
$timestamp = strtotime($timeElement->datetime);
|
||||
if ($timestamp !== false) {
|
||||
$item['timestamp'] = $timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
// Extract author
|
||||
$authorLink = $footer->find('.author a', 0);
|
||||
if ($authorLink) {
|
||||
$item['author'] = trim($authorLink->plaintext);
|
||||
}
|
||||
}
|
||||
|
||||
// Only add item if we have at least title and content
|
||||
if (!empty($item['title']) && !empty($item['content'])) {
|
||||
$this->items[] = $item;
|
||||
$itemCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user