mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-24 17:13:27 +02:00
Compare commits
4 Commits
2023-07-11
...
2023-07-13
Author | SHA1 | Date | |
---|---|---|---|
|
b9102d7e87 | ||
|
0f2b55fbef | ||
|
69aa751f40 | ||
|
b3bf95bfdd |
25
bridges/SteamGroupAnnouncementsBridge.php
Normal file
25
bridges/SteamGroupAnnouncementsBridge.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
class SteamGroupAnnouncementsBridge extends FeedExpander
|
||||
{
|
||||
const MAINTAINER = 'Jisagi';
|
||||
const NAME = 'Steam Group Announcements';
|
||||
const URI = 'https://steamcommunity.com/';
|
||||
const DESCRIPTION = 'Returns latest announcements from a steam group.';
|
||||
|
||||
const PARAMETERS = [
|
||||
[
|
||||
'g' => [
|
||||
'name' => 'Group name',
|
||||
'exampleValue' => 'freegamesfinders',
|
||||
'required' => true
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
public function collectData()
|
||||
{
|
||||
$uri = self::URI . 'groups/' . $this->getInput('g') . '/rss';
|
||||
$this->collectExpandableDatas($uri, 10);
|
||||
}
|
||||
}
|
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
final class Configuration
|
||||
{
|
||||
private const VERSION = 'dev.2023-03-22';
|
||||
private const VERSION = 'dev.2023-07-11';
|
||||
|
||||
private static $config = [];
|
||||
|
||||
|
@@ -11,8 +11,8 @@ class TwitterClient
|
||||
public function __construct(CacheInterface $cache)
|
||||
{
|
||||
$this->cache = $cache;
|
||||
$this->authorization = 'AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA';
|
||||
$this->data = $cache->loadData() ?? [];
|
||||
$this->authorization = 'AAAAAAAAAAAAAAAAAAAAAGHtAgAAAAAA%2Bx7ILXNILCqkSGIzy6faIHZ9s3Q%3DQy97w6SIrzE7lQwPJEYQBsArEE2fC25caFwRBvAGi456G09vGR';
|
||||
$this->data = $this->cache->loadData() ?? [];
|
||||
}
|
||||
|
||||
public function fetchUserTweets(string $screenName): \stdClass
|
||||
@@ -95,6 +95,9 @@ class TwitterClient
|
||||
$response = getContents($url, $this->createHttpHeaders(), [CURLOPT_POST => true]);
|
||||
$guest_token = json_decode($response)->guest_token;
|
||||
$this->data['guest_token'] = $guest_token;
|
||||
|
||||
$this->cache->setScope('twitter');
|
||||
$this->cache->setKey(['cache']);
|
||||
$this->cache->saveData($this->data);
|
||||
Logger::info("Fetch new guest token: $guest_token");
|
||||
}
|
||||
@@ -119,6 +122,9 @@ class TwitterClient
|
||||
}
|
||||
$userInfo = $response->data->user;
|
||||
$this->data[$screenName] = $userInfo;
|
||||
|
||||
$this->cache->setScope('twitter');
|
||||
$this->cache->setKey(['cache']);
|
||||
$this->cache->saveData($this->data);
|
||||
return $userInfo;
|
||||
}
|
||||
|
Reference in New Issue
Block a user