mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 13:12:41 +00:00
New UA string
• Now Arsse exposes itself properly • Conf->userAgentString exists to allow for specifying the string through configuration
This commit is contained in:
parent
f902346b6c
commit
85800b111e
2 changed files with 8 additions and 1 deletions
|
@ -29,6 +29,7 @@ class Conf {
|
|||
public $userComposeNames = true;
|
||||
public $userTempPasswordLength = 20;
|
||||
|
||||
public $userAgentString = 'Arsse (https://code.jkingweb.ca/jking/arsse)';
|
||||
|
||||
public function __construct(string $import_file = "") {
|
||||
if($import_file != "") $this->importFile($import_file);
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace JKingWeb\Arsse;
|
||||
use PicoFeed\Reader\Reader;
|
||||
use PicoFeed\PicoFeedException;
|
||||
use PicoFeed\Reader\Favicon;
|
||||
use PicoFeed\Config\Config;
|
||||
|
||||
class Feed {
|
||||
public $data = null;
|
||||
|
@ -13,7 +15,11 @@ class Feed {
|
|||
|
||||
public function __construct(string $url, string $lastModified = '', string $etag = '', string $username = '', string $password = '') {
|
||||
try {
|
||||
$this->reader = new Reader;
|
||||
$config = new Config;
|
||||
$config->setClientUserAgent(Data::$conf->userAgentString);
|
||||
$config->setGrabberUserAgent(Data::$conf->userAgentString);
|
||||
|
||||
$this->reader = new Reader($config);
|
||||
$this->resource = $reader->download($url, $lastModified, $etag, $username, $password);
|
||||
// Grab the favicon for the feed; returns an empty string if it cannot find one.
|
||||
$this->favicon = (new Favicon)->find($url);
|
||||
|
|
Loading…
Reference in a new issue