Commit graph

114 commits

Author SHA1 Message Date
sysadminstory
52d3cce59d
bridges: add context to detectParameters (#3607)
* bridges: add context to detectParameters

Some bridges did not return the context parameter but they used it in
the parameters

* bridges: add context to detectParameters

Fix test for InstagramBridge
2023-08-09 22:40:24 +02:00
csisoap
556bca58cf
[TwitterBridge] Fix search, user, list ID (#3566)
* Add ability to fetch user, list tweet

* Fix user, search, list ID although list still broke

* clear whitespace

* Revert CACHE_TIMEOUT

* clear whitespace, change single quote

* Clear PHP warning, add ability to get full-text if truncated

* Clear PHP warning

* clear warning

* clear whitespace

* Add check condition for mediaDetails.

* Add whitespace

* Add try catch exception for get full-text tweet

* clear warning

* clear warning
2023-07-25 22:36:41 +02:00
Dag
d08b2616ef
feat(twitter): use account icon as feed icon, fix #3348 (#3561) 2023-07-21 20:26:22 +02:00
Dag
6254b8593e
refactor(cache): extract and encapsulate cache expiration logic (#3547)
* refactor(cache): extract and encapsulate cache expiration logic

* fix: logic bug in getSimpleHTMLDOMCached

* fix: silly me, index should of course be on the key column

* silly me again, PRIMARY keys get index by default lol

* comment out the delete portion in loadData

* remove a few log statements

* tweak twitter cache timeout
2023-07-19 05:05:49 +02:00
Dag
c1c8304fc0
refactor: dont create multiple instances of the cache (#3504) 2023-07-08 17:03:12 +02:00
Dag
5e22459eb6
fix: remove unnecessary calls to purgeCache (#3502) 2023-07-06 18:52:19 +02:00
Dag
caac7f572c
refacor: improve cache interface (#3492)
* fix: proper typehint on setScope

* refactor: type hint setKey()

* typehint
2023-07-06 15:10:30 +02:00
Dag
88f646cf12
fix(TwitterBridge): trim screen name before passing it to twitter client (#3389) 2023-05-10 21:59:50 +02:00
Dag
49d105fd70
fix(TwitterBridge): remove ampersand from screen name, api dont like it (#3388) 2023-05-10 21:55:47 +02:00
Dag
ff49c9f731
fix(TwitterBridge): repair fetching of tweets by username (#3385)
* feat: alpha version of new twitter bridge

* fix: refetch guest_token if expired

* fix: purge cache

* fix: safeguards

* fix

* fix: two notices

* fix

* fix: use factory to create cache

* fix: fail properly instead of die()
2023-05-10 21:45:44 +02:00
Dag
94ae098ef5
fix: various fixes (#3023)
* improve twitch error message

* fix worldcosplay notice

* fix: add new video image to telegram

* fix: reuters

* fix: formula1

* twitter
2022-09-09 20:18:50 +02:00
Dag
ecb486794b
refactor: use static values for cache scope
This fixes a future problem when code is placed under a namespace because `get_class($bridge)` will then return e.g. `RssBridge\Bridge\TwitterBridge` instead of the the current value `TwitterBridge`.

Also a bit refactoring of `Configuration.php`.
2022-08-02 15:03:54 +02:00
Jan Tojnar
951092eef3
Fix coding style missed by phpbcf (#2901)
$ composer require --dev friendsofphp/php-cs-fixer

$ echo >.php-cs-fixer.dist.php "<?php

$finder = PhpCsFixer\Finder::create()
    ->in(__DIR__);

$rules = [
    '@PSR12' => true,
    // '@PSR12:risky' => true,
    '@PHP74Migration' => true,
    // '@PHP74Migration:risky' => true,
    // buggy, duplicates existing comment sometimes
    'no_break_comment' => false,
    'array_syntax' => true,
    'lowercase_static_reference' => true,
    'visibility_required' => false,
    // Too much noise
    'binary_operator_spaces' => false,
    'heredoc_indentation' => false,
    'trailing_comma_in_multiline' => false,
];

$config = new PhpCsFixer\Config();

return $config
    ->setRules($rules)
    // ->setRiskyAllowed(true)
    ->setFinder($finder);

"

$ vendor/bin/php-cs-fixer --version
PHP CS Fixer 3.8.0 BerSzcz against war! by Fabien Potencier and Dariusz Ruminski.
PHP runtime: 8.1.7

$ vendor/bin/php-cs-fixer fix
$ rm .php-cs-fixer.cache
$ vendor/bin/php-cs-fixer fix
2022-07-08 13:00:52 +02:00
Jan Tojnar
d107f8ed30
Improve Factory variable names (#2895) 2022-07-06 12:14:04 +02:00
Dag
321ec7c8c1
refactor: move cache logic into the factory (#2884) 2022-07-05 13:20:01 +02:00
Dag
4f75591060
Reformat codebase v4 (#2872)
Reformat code base to PSR12

Co-authored-by: rssbridge <noreply@github.com>
2022-07-01 15:10:30 +02:00
Dag
5076d09de6
refactor: prepare for PSR2 (#2859) 2022-06-24 18:29:35 +02:00
Dag
07927008eb
refactor: CacheFactory (#2834) 2022-06-22 18:29:28 +02:00
Dag
5d77d14f9d
feat: add retry logic to the http client (#2692)
* refactor: extract http client

* feat: add retry logic to http client
2022-05-08 03:58:57 +02:00
arnd-s
0d305f1530
[TwitterBridge] Migration to API V1.1 (#2433) 2022-04-04 19:50:59 +02:00
Bocki
1a8d0babd1
[Multiple] Fix all exampleValues and required variables (#2296) 2022-03-24 11:59:34 +01:00
Eugene Molotov
73a5dd928a
[TwitterBridge] Don't decode HTML entities for feed content (#2470) 2022-02-24 00:28:29 +05:00
Eugene Molotov
2f10d2345a [TwitterBridge] Meet the new maintainer: arnd-s 2022-01-16 23:42:28 +05:00
arnd-s
02a8ae4c62
[TwitterBridge] Use Twitter API V1.1 guest/activate for requesting new guest tokens (#2414)
Instead of searching inside base html page for the guest token, this patch instead uses the Twitter API V1.1 to acquire guest tokens
2022-01-16 07:59:02 +05:00
arnd-s
12ff697ab0
[TwitterBridge] Continue using existing guesttoken from cache, when requesting a new one failed (#2396) 2022-01-06 10:59:37 +05:00
triatic
35930ee4e4
[TwitterBridge] Increase guest token expiry time (#2374) 2021-12-18 14:54:18 +05:00
FiveFilters.org
76c38332ee
[TwitterBridge] Improve timeline processing for username mode (#1946) 2021-04-12 23:08:38 +05:00
FiveFilters.org
f927781750
[TwitterBridge] Add option to hide pinned tweet (#1908) 2021-01-10 13:50:06 +05:00
Derrick Lee
6b870f0c3e
[TwitterBridge] Fix username matching to be case insensitive with noretweet option (#1924) 2021-01-10 13:19:38 +05:00
Roman Remizov
b66026e241
[TwitterBridge] Add support for querying by list ID (#1834) 2020-11-10 11:12:02 +05:00
triatic
d3455dd18a
[TwitterBridge] Optimise regular expression code (#1768)
* [TwitterBridge] Optimise regular expression code

Optimise regular expression search code so adding new URLs is cleaner
2020-10-05 12:07:39 +05:00
sarnd
01985b7af7
[TwitterBridge] URL to js file with apikey changed again (#1764) 2020-09-28 10:01:37 +05:00
Eugene Molotov
6c244f4d9b
[TwitterBridge] Skip advertisment tweets (#1673) 2020-09-11 11:44:28 +05:00
ronansalmon
25cff9c07b
[TwitterBridge] Convert plain text URLs into HTML hyperlinks (#1627) 2020-08-21 17:55:11 +05:00
triatic
73287f536b
[TwitterBridge] Add retweeter to retweeted tweets (#1679) 2020-08-20 10:00:27 +05:00
triatic
268ddf1382
[TwitterBridge] URL to js file with apikey changed (#1698)
Fixes #1697
2020-08-12 10:32:34 +05:00
sarnd
c71fad4a4a
[TwitterBridge] URL to js file with apikey changed. (#1686)
Twitter has changed URL scheme back again (see PR#1647 / commit 78298385d0)

This patch will try both URL schemes now and throw a specific error when neither works
2020-08-06 10:22:17 +05:00
Eugene Molotov
5be251a66e
[TwitterBridge] Fetch latest tweets on hashtag or keyword query (#1674) 2020-08-02 19:40:41 +05:00
triatic
f5916a2f74
[TwitterBridge] apikey fetched every time (#1663)
The apikey is fetched every time because $data is not an array. Update the condition to expire the api key at the same time as the guest token.
2020-07-30 09:54:16 +05:00
somini
78facbcb83
[TwitterBridge] Fix noretweet for users (#1608)
This also removes spurious retweets.
2020-07-26 11:26:39 +05:00
triatic
25698d182c [TwitterBridge] Remove unused variable 2020-07-24 13:13:21 +05:00
sarnd
78298385d0
[TwitterBridge] guest token is returned via body again. (#1647)
* [TwitterBridge] guest token is returned via body again. This change will try to search fot token inside header and fallback to body

* Twitter changed the URL scheme for the API
2020-07-24 12:52:27 +05:00
sarnd
e87b868307
[TwitterBridge] Fix issue #1621 @<twitter_user> failed with error 429 (#1622)
* [TwitterBridge] Fix issue #1621 @<twitter_user> failed with error 429
2020-06-25 12:21:48 +02:00
triatic
23c61f5f84
[TwitterBridge] Expire guest token by time (#1606)
* [TwitterBridge] Expire guest token by time

In addition to fetching a new guest token after 100 uses, also expire token after 5 minutes (configurable).
2020-06-23 15:14:50 +02:00
somini
22a01f1093
[Twitter] Fix Twitter bridge images and add other media types (#1595)
* Keep old URI structure

Use the username, not the user ID.

* Fix Twitter bridge images

Credit to @kinoushe

See https://github.com/RSS-Bridge/rss-bridge/issues/1562#issuecomment-639393175

* Include Videos and "Animated GIF" as twit enclosures

Credit to @kinoushe for digging into the API docs.

https://github.com/RSS-Bridge/rss-bridge/issues/1562#issuecomment-640320688

* Calculate the highest bitrate video

Include that on the enclosure.

* Appease linter

* Appease linter, again

* Remove surrounding link from videos

Add it on a smaller link besides it.

See
https://github.com/RSS-Bridge/rss-bridge/pull/1595#issuecomment-640989208

* Include video poster on the enclosures.
2020-06-10 22:39:36 +02:00
Lyra
124631df73 [TwitterBridge] Fix caching policy, usernames as well as images 2020-06-08 11:18:24 +02:00
Lyra
06891ae35f [TwitterBridge] Fix the bridge using a brand new API 2020-06-05 10:17:53 +02:00
Eugene Molotov
830f57f607
[TwitterBridge] Use IE's user-agent (#1442)
Twitter will return pages with legacy design and frontend code, which bridge can deal with
2020-01-31 14:36:25 +01:00
triatic
50c971d545 [TwitterBridge] Enable cookies with curl (#1245)
* [TwitterBridge] Enable cookies with curl

Enable cookies in curl, or fall back to `file_get_contents` if in CLI mode with no curl root certificates.
2019-09-12 16:14:48 +02:00
triatic
2bb9480555 [TwitterBridge] Get cookies before sending request (#1232)
* [TwitterBridge] Get cookies before sending request

Twitter now requires cookies to be set before requesting a page. This will fetch the cookies and send them to `getSimpleHTMLDOM()`.

* Formatting fixes
2019-07-26 10:36:59 +02:00