-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NVIDIADriverBridge] Initial Commit (#4198)
* [NVIDIADriverBridge] Initial Commit Fetch the latest NVIDIA Linux driver updates * Update NVIDIADriverBridge.php * refactor * rename --------- Co-authored-by: Dag <[email protected]>
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
class NvidiaDriverBridge extends FeedExpander | ||
{ | ||
const NAME = 'NVIDIA Linux Driver Releases'; | ||
const URI = 'https://www.nvidia.com/Download/processFind.aspx'; | ||
const DESCRIPTION = 'Fetch the latest NVIDIA Linux driver updates'; | ||
const MAINTAINER = 'tillcash'; | ||
const PARAMETERS = [ | ||
[ | ||
'whql' => [ | ||
'name' => 'Version', | ||
'type' => 'list', | ||
'values' => [ | ||
'All' => '', | ||
'Beta' => '0', | ||
'New Feature Branch' => '5', | ||
'Recommended/Certified' => '1', | ||
], | ||
], | ||
], | ||
]; | ||
|
||
public function collectData() | ||
{ | ||
$whql = $this->getInput('whql'); | ||
|
||
$parameters = [ | ||
'lid' => 1, // en-us | ||
'psid' => 129, // GeForce | ||
'osid' => 12, // Linux 64-bit | ||
'whql' => $whql, | ||
]; | ||
|
||
$url = 'https://www.nvidia.com/Download/processFind.aspx?' . http_build_query($parameters); | ||
$dom = getSimpleHTMLDOM($url); | ||
|
||
foreach ($dom->find('tr#driverList') as $element) { | ||
$id = str_replace('img_', '', $element->find('img', 0)->id); | ||
|
||
$this->items[] = [ | ||
'timestamp' => $element->find('td.gridItem', 3)->plaintext, | ||
'title' => sprintf('NVIDIA Linux Driver %s', $element->find('td.gridItem', 2)->plaintext), | ||
'uri' => 'https://www.nvidia.com/Download/driverResults.aspx/' . $id, | ||
'content' => $dom->find('tr#tr_' . $id . ' span', 0)->innertext, | ||
]; | ||
} | ||
} | ||
} |