1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-24 17:13:27 +02:00

Compare commits

..

4 Commits

Author SHA1 Message Date
Jisagi
b9102d7e87 Add Steam Group Announcements Bridge (#3527)
* Create SteamGroupAnnouncementsBridge.php

* Shorten implementation

Maybe this fixes the tests

* test

---------

Co-authored-by: Dag <me@dvikan.no>
2023-07-13 17:23:12 +02:00
Fake4d
0f2b55fbef Update Configuration.php - Old Version Date in new Release (#3526)
Old Version Date in new Release
2023-07-12 11:56:07 +02:00
Dag
69aa751f40 fix(cache): bug in prior refactor (#3525)
* fix(cache): bug in prior refactor

* yup
2023-07-11 23:26:22 +02:00
csisoap
b3bf95bfdd Replace token for Twitter. (#3522) 2023-07-11 23:17:38 +02:00
3 changed files with 34 additions and 3 deletions

View 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);
}
}

View File

@@ -19,7 +19,7 @@
*/
final class Configuration
{
private const VERSION = 'dev.2023-03-22';
private const VERSION = 'dev.2023-07-11';
private static $config = [];

View File

@@ -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;
}