Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from RSS-Bridge:master #163

Open
wants to merge 89 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
adcc8e3
[TarnkappeBridge] changed "unwanted stuff" (#4206)
Tone866 Aug 9, 2024
4ef5ca5
[KemonoBridge] Add KemonoBridge (#4192)
Phantop Aug 10, 2024
129b8a3
[ModifyBridge] New bridge to modify feeds (#4164)
Mynacol Aug 10, 2024
2e6e246
[KemonoBridge] attempt to fix malformed tag responses (#4209)
Phantop Aug 10, 2024
133dbf8
fix(telegram): add note if content is omitted from preview page (#4210)
dvikan Aug 10, 2024
4424ea5
chore: increase linter speed (#4211)
dvikan Aug 11, 2024
307c222
[ActivisionResearchBridge] New bridge for the Activision Research blo…
thefranke Aug 11, 2024
e9d3a65
[EASeedBridge] New bridge for the EA Seed blog (#4216)
thefranke Aug 14, 2024
c0e37bc
refactor: frontpage and proxy setting (#4214)
dvikan Aug 18, 2024
320afc3
[MaalaimalarBridge] fix image (#4222)
tillcash Aug 19, 2024
2d5d2f5
[NvidiaDriverBridge] fix typo (#4224)
tillcash Aug 20, 2024
3a32750
[NPRBridge] add bridge for NPR stories (#4225)
Phantop Aug 21, 2024
d379f3e
[CubariProxyBridge] add bridge for cubari manga proxies (#4220)
Phantop Aug 21, 2024
06a8896
[PriviblurBridge] Add Priviblur (Tumblr frontend) bridge (#4221)
Phantop Aug 21, 2024
4a3919c
[NPRBridge] Add missing tag and remove extra HTML elements (#4227)
Phantop Aug 21, 2024
05e2c35
refactor: less reliance on super globals (#4228)
dvikan Aug 21, 2024
b0674d7
[BMDSystemhausBlogBridge] rework detectParameters (#4138)
cn-tools Aug 22, 2024
c849576
fix(rumble): fix guid bug (#4232)
dvikan Aug 23, 2024
6516e31
refactor: format rendering (#4229)
dvikan Aug 23, 2024
d51cc8f
Fixed path in CeskaTelevizeBridge (#4236)
kolarcz Aug 28, 2024
e010fd4
[HinduTamilBridge] fix image (#4237)
tillcash Aug 28, 2024
58544cd
refactor: introduce DI container (#4238)
dvikan Aug 29, 2024
e7ae06d
fix: bug in prior refactor (#4239)
dvikan Aug 29, 2024
39952c2
refactor: implement middleware chain (#4240)
dvikan Aug 29, 2024
9f48370
fix: tweak caching logic (#4241)
dvikan Aug 29, 2024
3e1a8b2
fix: extract duplicate config loading (#4242)
dvikan Aug 30, 2024
bb2f471
fix: bug in prior fix (#4243)
dvikan Aug 30, 2024
6a24e53
refactor (#4244)
dvikan Aug 30, 2024
9cabf60
docs
dvikan Aug 30, 2024
36fd72c
[ABCNewsBridge] Fix broken due to site redesign (#4247)
bloominstrong Aug 31, 2024
a6bdc32
refactor: extract exception and cache middleware (#4248)
dvikan Sep 1, 2024
486191b
fix(cve_details) (#4251)
dvikan Sep 2, 2024
3dc8b65
[GovTrackBridge] Add feed for GovTrack events and blog (#4231)
Phantop Sep 2, 2024
293d04f
fix(spotify): detect rate limiting (#4253)
dvikan Sep 3, 2024
358bebb
[EconomistWorldInBriefBridge] Fix bridge (#4258)
SqrtMinusOne Sep 7, 2024
40041dd
[DailythanthiBridge] fix url (#4261)
tillcash Sep 9, 2024
d9316cd
[PicukiBridge] Try to fix the bridge (#4262)
sysadminstory Sep 11, 2024
80c43f1
[TCBScansBridge] Add bridge (#4263)
osvfj Sep 12, 2024
af26d84
Include all bridges in tarballs
Mynacol Oct 7, 2024
63c16e4
[prtester] Rework test storage (#4292)
Bockiii Oct 16, 2024
6aba9fd
[MaalaimalarBridge] fix url (#4295)
tillcash Oct 16, 2024
eb21e97
[OvertakeBridge] Renamed RaceDepartmentBridge to OvertakeBridge (#4294)
t0stiman Oct 16, 2024
3a5de75
[CarThrottleBridge] update for new layout (#4285)
t0stiman Oct 16, 2024
cdf21d4
[RutubeBridge] Multiple fixes (#4284)
em92 Oct 16, 2024
f89c75b
[ArsTechnicaBridge] Fix the bridge after redesign (#4282)
SqrtMinusOne Oct 16, 2024
bd82310
[maint] Update instance location (#4279)
vlnst Oct 16, 2024
5d83050
[ForensicArchitectureBridge] Add Bridge (#4280)
tillcash Oct 16, 2024
0c96a47
Remove PanacheDigitalGamesBridge (#4277)
somini Oct 16, 2024
e7d6f89
[ForensicArchitecture] Remove for bugfixing (#4297)
Bockiii Oct 16, 2024
e5e2059
[maint] Update all workflow action versions (#4298)
Bockiii Oct 16, 2024
776e272
[maint] fix phpunit test (#4300)
Bockiii Oct 16, 2024
70cf917
[ForensicArchitecture] Create ForensicArchitectureBridge.php (#4301)
Bockiii Oct 16, 2024
664436c
[prtester] Optimize tester workflow (#4303)
Bockiii Oct 16, 2024
56994b3
[ZeitBridge] Remove content from original feed (#4260)
AlexanderS Oct 17, 2024
bd88bc2
[TheDrive] New bridge (#4304)
t0stiman Oct 17, 2024
51cdb66
[HarvardBusinessReviewBridge] Add bridge (#4293)
tbelbek Oct 17, 2024
f9a51b6
[AppleMusicBridge] Further data request to receive artist information…
jonastaedcke Oct 18, 2024
b9eb3c8
[PCGWNewsBridge] Remove bridge (#4305)
somini Oct 18, 2024
668f3a9
[AppleMusicBridge] fix linting error (#4308)
ajain-93 Oct 19, 2024
6c88f2c
[prtester] fix prtester no longer supporting multiple bridges being c…
User123698745 Oct 19, 2024
c3dc46a
[prtester] Update python dependency (#4311)
rakoo Oct 20, 2024
bc536f3
[DäcksnackBridge] New Bridge (#4309)
ajain-93 Nov 3, 2024
082542d
[TestFaktaBridge] new bridge (#4307)
ajain-93 Nov 3, 2024
29d984c
[TagesspiegelBridge] Add bridge for tagesspiegel.de (#4270)
AlexanderS Nov 3, 2024
bd0fb1d
[IdealoBridge] Fix (#4316)
sysadminstory Nov 3, 2024
8d6d0fa
[DuvarOrgBridge] Add Duvar.org bridge for scraping news articles (#4315)
tbelbek Nov 3, 2024
1cd5b07
Formatting fix "For Hosts" documentation (#4317)
TangentFoxy Nov 3, 2024
dd165ea
[HuntShowdownNewsBridge] Fetches the latest articles from Hunt Showdo…
deffy92 Nov 4, 2024
6c86e2c
[IdealoBridge] Really fix Logic and enhance Feed Content (#4321)
sysadminstory Nov 8, 2024
2294dac
[AO3Bridge] Add fetch limit to reduce requests (#4328)
Phantop Nov 23, 2024
9457e07
[PriviblurBridge] Fix invalid favicon, use either Tumblr or blog icon…
Phantop Nov 23, 2024
a6e8760
[FragDenStaatBridge] add new bridge (#4330)
swofl Nov 23, 2024
2ee615e
[PepperBridgeAbstract, DealabsBridge, HotUKDealsBridge, MydealsBridge…
sysadminstory Nov 23, 2024
086ef7f
feat: add WKYT bridge (#4337)
mattconnell Nov 23, 2024
e3260ff
[NordbayernBridge] fill item categories if available (#4338)
swofl Nov 23, 2024
628b302
fix: dont aquire exclusive locks (#4340)
dvikan Nov 23, 2024
83bc3fd
[DRKBlutspendeBridge] add new bridge (#4324)
User123698745 Nov 24, 2024
74496e2
[MixologyBridge] add new bridge (#4331)
swofl Nov 24, 2024
ec6f98e
Added Alternate way to get Price if no buttons available (#4342)
SebLaus Nov 24, 2024
b42a993
[Bluesky] New bridge (#4341)
thomas-333 Nov 25, 2024
c651e11
[MaalaimalarBridge] fix new url (#4344)
tillcash Nov 25, 2024
c7f9870
[OLXBridge] fix title and shiping info retrieval (#4346)
wrobelda Nov 26, 2024
88ccc60
[CubariProxyBridge] Fix favicon (#4347)
Phantop Nov 26, 2024
6a81fc0
fix(file_cache): if write failure, produce log record instead of exce…
dvikan Nov 28, 2024
d956471
[QwenBlogBridge] Add bridge (#4353)
SqrtMinusOne Dec 2, 2024
59d77d4
[TikTokBridge] Include author profile picture (#4354)
PredaaA Dec 4, 2024
17d142c
Add StorytelBridge for Storytel list fetching (#4355)
Okbaydere Dec 4, 2024
bf4a918
[MistralAIBridge] Add Mistral (#4356)
SqrtMinusOne Dec 5, 2024
4685bbd
[EdfPricesBridge] fixing bridge (#4360)
floviolleau Dec 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ phpcs.xml export-ignore
phpcompatibility.xml export-ignore
tests/ export-ignore
cache/.gitkeep export-ignore
bridges/DemoBridge.php export-ignore
bridges/FeedExpanderExampleBridge.php export-ignore

## Composer
#
Expand Down
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
# Generated files
comment*.md
comment*.txt
*.html
40 changes: 29 additions & 11 deletions .github/prtester.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from bs4 import BeautifulSoup
from datetime import datetime
from typing import Iterable
import os.path
import os
import glob
import urllib

# This script is specifically written to be used in automation for https://github.com/RSS-Bridge/rss-bridge
Expand All @@ -14,18 +15,33 @@
# It also add a <base> tag with the url of em's public instance, so viewing
# the HTML file locally will actually work as designed.

ARTIFACT_FILE_EXTENSION = '.html'

class Instance:
name = ''
url = ''

def main(instances: Iterable[Instance], with_upload: bool, with_reduced_upload: bool, title: str, output_file: str):
start_date = datetime.now()

prid = os.getenv('PR')
artifact_base_url = f'https://rss-bridge.github.io/rss-bridge-tests/prs/{prid}'
artifact_directory = os.getcwd()
for file in glob.glob(f'*{ARTIFACT_FILE_EXTENSION}', root_dir=artifact_directory):
os.remove(file)

table_rows = []
for instance in instances:
page = requests.get(instance.url) # Use python requests to grab the rss-bridge main page
soup = BeautifulSoup(page.content, "html.parser") # use bs4 to turn the page into soup
bridge_cards = soup.select('.bridge-card') # get a soup-formatted list of all bridges on the rss-bridge page
table_rows += testBridges(instance, bridge_cards, with_upload, with_reduced_upload) # run the main scraping code with the list of bridges
table_rows += testBridges(
instance=instance,
bridge_cards=bridge_cards,
with_upload=with_upload,
with_reduced_upload=with_reduced_upload,
artifact_directory=artifact_directory,
artifact_base_url=artifact_base_url) # run the main scraping code with the list of bridges
with open(file=output_file, mode='w+', encoding='utf-8') as file:
table_rows_value = '\n'.join(sorted(table_rows))
file.write(f'''
Expand All @@ -37,7 +53,7 @@ def main(instances: Iterable[Instance], with_upload: bool, with_reduced_upload:
*last change: {start_date.strftime("%A %Y-%m-%d %H:%M:%S")}*
'''.strip())

def testBridges(instance: Instance, bridge_cards: Iterable, with_upload: bool, with_reduced_upload: bool) -> Iterable:
def testBridges(instance: Instance, bridge_cards: Iterable, with_upload: bool, with_reduced_upload: bool, artifact_directory: str, artifact_base_url: str) -> Iterable:
instance_suffix = ''
if instance.name:
instance_suffix = f' ({instance.name})'
Expand Down Expand Up @@ -103,13 +119,13 @@ def testBridges(instance: Instance, bridge_cards: Iterable, with_upload: bool, w
selectionvalue = selectionentry.get('value')
break
context_parameters[listname] = selectionvalue
termpad_url = 'about:blank'
artifact_url = 'about:blank'
if error_messages:
status = '<br>'.join(map(lambda m: f'❌ `{m}`', error_messages))
else:
# if all example/default values are present, form the full request url, run the request, add a <base> tag with
# the url of em's public instance to the response text (so that relative paths work, e.g. to the static css file) and
# then upload it to termpad.com, a pastebin-like-site.
# then save it to a html file.
context_parameters.update({
'action': 'display',
'bridge': bridgeid,
Expand Down Expand Up @@ -140,16 +156,18 @@ def testBridges(instance: Instance, bridge_cards: Iterable, with_upload: bool, w
if status_is_ok:
status = '✔️'
if with_upload and (not with_reduced_upload or not status_is_ok):
termpad = requests.post(url="https://termpad.com/", data=page_text)
termpad_url = termpad.text.strip()
termpad_url = termpad_url.replace('termpad.com/','termpad.com/raw/')
table_rows.append(f'| {bridge_name} | [{form_number} {context_name}{instance_suffix}]({termpad_url}) | {status} |')
filename = f'{bridge_name} {form_number}{instance_suffix}{ARTIFACT_FILE_EXTENSION}'
filename = re.sub(r'[^a-z0-9 \_\-\.]', '', filename, flags=re.I).replace(' ', '_')
with open(file=f'{artifact_directory}/{filename}', mode='wb') as file:
file.write(page_text)
artifact_url = f'{artifact_base_url}/{filename}'
table_rows.append(f'| {bridge_name} | [{form_number} {context_name}{instance_suffix}]({artifact_url}) | {status} |')
form_number += 1
return table_rows

def getFirstLine(value: str) -> str:
# trim whitespace and remove text that can break the table or is simply unnecessary
clean_value = re.sub('^\[[^\]]+\]\s*rssbridge\.|[\|`]', '', value.strip())
clean_value = re.sub(r'^\[[^\]]+\]\s*rssbridge\.|[\|`]', '', value.strip())
first_line = next(iter(clean_value.splitlines()), '')
max_length = 250
if (len(first_line) > max_length):
Expand Down Expand Up @@ -187,4 +205,4 @@ def getFirstLine(value: str) -> str:
with_reduced_upload=args.reduced_upload and not args.no_upload,
title=args.title,
output_file=args.output_file
);
);
12 changes: 6 additions & 6 deletions .github/workflows/dockerbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
-
name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKERHUB_SLUG }}
Expand All @@ -33,26 +33,26 @@ jobs:
type=raw,value=stable,enable=${{ startsWith(github.ref, 'refs/tags/20') }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/bake-action@v2
uses: docker/bake-action@v5
with:
files: |
./docker-bake.hcl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup PHP
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
php-versions: ['7.4']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
Expand All @@ -26,7 +26,7 @@ jobs:
matrix:
php-versions: ['7.4']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
Expand All @@ -38,7 +38,7 @@ jobs:
executable_php_files_check:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: |
if find -name "*.php" -executable -type f -print -exec false {} +
then
Expand Down
67 changes: 62 additions & 5 deletions .github/workflows/prhtmlgenerator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,30 @@ on:
branches: [ master ]

jobs:
check-bridges:
name: Check if bridges were changed
runs-on: ubuntu-latest
outputs:
BRIDGES: ${{ steps.check1.outputs.BRIDGES }}
steps:
- name: Check number of bridges
id: check1
run: |
PR=${{github.event.number}};
wget https://patch-diff.githubusercontent.com/raw/$GITHUB_REPOSITORY/pull/$PR.patch;
bridgeamount=$(cat $PR.patch | grep "\bbridges/[A-Za-z0-9]*Bridge\.php\b" | sed "s=.*\bbridges/\([A-Za-z0-9]*\)Bridge\.php\b.*=\1=g" | sort | uniq | wc -l);
echo "BRIDGES=$bridgeamount" >> "$GITHUB_OUTPUT"
test-pr:
name: Generate HTML
runs-on: ubuntu-latest
needs: check-bridges
if: needs.check-bridges.outputs.BRIDGES > 0
env:
PYTHONUNBUFFERED: 1
# Needs additional permissions https://github.com/actions/first-interaction/issues/10#issuecomment-1041402989
steps:
- name: Check out self
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
Expand All @@ -33,9 +48,9 @@ jobs:
docker build -t prbuild .;
docker run -d -v $GITHUB_WORKSPACE/whitelist.txt:/app/whitelist.txt -v $GITHUB_WORKSPACE/DEBUG:/app/DEBUG -p 3001:80 prbuild
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.13'
cache: 'pip'
- name: Install requirements
run: |
Expand All @@ -51,19 +66,61 @@ jobs:
body="${body//$'\n'/'%0A'}";
body="${body//$'\r'/'%0D'}";
echo "bodylength=${#body}" >> $GITHUB_OUTPUT
env:
PR: ${{ github.event.number }}
- name: Upload generated tests
uses: actions/upload-artifact@v4
id: upload-generated-tests
with:
name: tests
path: '*.html'
- name: Find Comment
if: ${{ steps.testrun.outputs.bodylength > 130 }}
uses: peter-evans/find-comment@v2
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Pull request artifacts
- name: Create or update comment
if: ${{ steps.testrun.outputs.bodylength > 130 }}
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-file: comment.txt
edit-mode: replace
upload_tests:
name: Upload tests
runs-on: ubuntu-latest
needs: test-pr
steps:
- uses: actions/checkout@v4
with:
repository: 'RSS-Bridge/rss-bridge-tests'
ref: 'main'
token: ${{ secrets.RSSTESTER_ACTION }}

- name: Setup git config
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "<>"

- name: Download tests
uses: actions/download-artifact@v4
with:
name: tests

- name: Move tests
run: |
cd prs
mkdir -p ${{github.event.number}}
cd ${{github.event.number}}
mv -f $GITHUB_WORKSPACE/*.html .

- name: Commit and push generated tests
run: |
export COMMIT_MESSAGE="Added tests for PR ${{github.event.number}}"
git add .
git commit -m "$COMMIT_MESSAGE"
git push
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ jobs:
matrix:
php-versions: ['7.4', '8.0', '8.1']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
env:
update: true
- run: composer install
- run: composer test
7 changes: 4 additions & 3 deletions actions/ConnectivityAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ class ConnectivityAction implements ActionInterface
{
private BridgeFactory $bridgeFactory;

public function __construct()
{
$this->bridgeFactory = new BridgeFactory();
public function __construct(
BridgeFactory $bridgeFactory
) {
$this->bridgeFactory = $bridgeFactory;
}

public function __invoke(Request $request): Response
Expand Down
16 changes: 11 additions & 5 deletions actions/DetectAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

class DetectAction implements ActionInterface
{
private BridgeFactory $bridgeFactory;

public function __construct(
BridgeFactory $bridgeFactory
) {
$this->bridgeFactory = $bridgeFactory;
}

public function __invoke(Request $request): Response
{
$url = $request->get('url');
Expand All @@ -14,14 +22,12 @@ public function __invoke(Request $request): Response
return new Response(render(__DIR__ . '/../templates/error.html.php', ['message' => 'You must specify a format']));
}

$bridgeFactory = new BridgeFactory();

foreach ($bridgeFactory->getBridgeClassNames() as $bridgeClassName) {
if (!$bridgeFactory->isEnabled($bridgeClassName)) {
foreach ($this->bridgeFactory->getBridgeClassNames() as $bridgeClassName) {
if (!$this->bridgeFactory->isEnabled($bridgeClassName)) {
continue;
}

$bridge = $bridgeFactory->create($bridgeClassName);
$bridge = $this->bridgeFactory->create($bridgeClassName);

$bridgeParams = $bridge->detectParameters($url);

Expand Down
Loading
Loading