mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-23 09:02:41 +00:00
Merge branch 'master' of https://code.jkingweb.ca/jking/arsse
This commit is contained in:
commit
f37e6659c8
2 changed files with 8 additions and 1 deletions
|
@ -29,6 +29,7 @@ class Conf {
|
||||||
public $userComposeNames = true;
|
public $userComposeNames = true;
|
||||||
public $userTempPasswordLength = 20;
|
public $userTempPasswordLength = 20;
|
||||||
|
|
||||||
|
public $userAgentString = 'Arsse (https://code.jkingweb.ca/jking/arsse)';
|
||||||
|
|
||||||
public function __construct(string $import_file = "") {
|
public function __construct(string $import_file = "") {
|
||||||
if($import_file != "") $this->importFile($import_file);
|
if($import_file != "") $this->importFile($import_file);
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
namespace JKingWeb\Arsse;
|
namespace JKingWeb\Arsse;
|
||||||
use PicoFeed\Reader\Reader;
|
use PicoFeed\Reader\Reader;
|
||||||
use PicoFeed\PicoFeedException;
|
use PicoFeed\PicoFeedException;
|
||||||
use PicoFeed\Reader\Favicon;
|
use PicoFeed\Reader\Favicon;
|
||||||
|
use PicoFeed\Config\Config;
|
||||||
|
|
||||||
class Feed {
|
class Feed {
|
||||||
public $data = null;
|
public $data = null;
|
||||||
|
@ -13,7 +15,11 @@ class Feed {
|
||||||
|
|
||||||
public function __construct(string $url, string $lastModified = '', string $etag = '', string $username = '', string $password = '') {
|
public function __construct(string $url, string $lastModified = '', string $etag = '', string $username = '', string $password = '') {
|
||||||
try {
|
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);
|
$this->resource = $reader->download($url, $lastModified, $etag, $username, $password);
|
||||||
// Grab the favicon for the feed; returns an empty string if it cannot find one.
|
// Grab the favicon for the feed; returns an empty string if it cannot find one.
|
||||||
$this->favicon = (new Favicon)->find($url);
|
$this->favicon = (new Favicon)->find($url);
|
||||||
|
|
Loading…
Reference in a new issue