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

[RedditBridge] Rewrite to use JSON #1781

Merged
merged 2 commits into from
Dec 23, 2020
Merged

[RedditBridge] Rewrite to use JSON #1781

merged 2 commits into from
Dec 23, 2020

Conversation

dawidsowa
Copy link
Contributor

It makes use of fact, that you can append .json to reddit url, to get it's JSON representation.
For example https://reddit.com/r/selfhosted/.json.

It's works, but I'm not sure if I've taken care of all possible content.

Fixes #1525

@somini
Copy link
Contributor

somini commented Oct 18, 2020

Great find, but I get some errors with the "selfhosted" example:

[Sun Oct 18 12:47:47 2020] PHP Notice:  Trying to get property 'oembed' of non-object in /home/somini/Programming/rss-bridge/bridges/RedditBridge.php on line 85
[Sun Oct 18 12:47:47 2020] PHP Notice:  Trying to get property 'html' of non-object in /home/somini/Programming/rss-bridge/bridges/RedditBridge.php on line 85
[Sun Oct 18 12:47:47 2020] PHP Notice:  Trying to get property 'oembed' of non-object in /home/somini/Programming/rss-bridge/bridges/RedditBridge.php on line 85
[Sun Oct 18 12:47:47 2020] PHP Notice:  Trying to get property 'html' of non-object in /home/somini/Programming/rss-bridge/bridges/RedditBridge.php on line 85
[Sun Oct 18 12:47:47 2020] PHP Notice:  Trying to get property 'oembed' of non-object in /home/somini/Programming/rss-bridge/bridges/RedditBridge.php on line 85
[Sun Oct 18 12:47:47 2020] PHP Notice:  Trying to get property 'html' of non-object in /home/somini/Programming/rss-bridge/bridges/RedditBridge.php on line 85
[Sun Oct 18 12:47:47 2020] /home/somini/Programming/rss-bridge/lib/FeedItem.php:111 class FeedItem->__set - Category must be a string!

@somini
Copy link
Contributor

somini commented Oct 19, 2020

LGTM, but Travis complains about a function missing in PHP 7.2, which is already abandoned years ago:

https://travis-ci.com/github/RSS-Bridge/rss-bridge/jobs/401740548#L556

@dawidsowa dawidsowa marked this pull request as ready for review November 29, 2020 12:45
@em92
Copy link
Contributor

em92 commented Dec 13, 2020

Hi, @dawidsowa !
Youtube links are broken. https://feed.eugenemolotov.ru/r_python.html
Everything else looks fine.

@dawidsowa
Copy link
Contributor Author

Ok, that fixes it.

@em92 em92 merged commit 3c285d5 into RSS-Bridge:master Dec 23, 2020
@em92
Copy link
Contributor

em92 commented Dec 23, 2020

gj @dawidsowa !

@kinoushe
Copy link

Works well, thank you!

How hard would it be to implement the same function for users also, e.g:
https://www.reddit.com/user/username/.json

@dawidsowa
Copy link
Contributor Author

Data structure seems to be the same, so it should be easy.
I've already planned to do it in 2 weeks or so, when I'll be less busy.

@kinoushe
Copy link

Wonderful, looking forward, thanks @dawidsowa!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Full image for Reddit bridge
4 participants