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

Start an MVP for including Twitch streams in Telescope #2728

Closed
AmasiaNalbandian opened this issue Jan 25, 2022 · 9 comments · Fixed by #2788
Closed

Start an MVP for including Twitch streams in Telescope #2728

AmasiaNalbandian opened this issue Jan 25, 2022 · 9 comments · Fixed by #2788
Assignees
Milestone

Comments

@AmasiaNalbandian
Copy link
Contributor

AmasiaNalbandian commented Jan 25, 2022

Research:

  • Twitch API integration in back-end?
  • MVP(Minimum Viable Product) of Twitch component for front-end

Look up the details for what we can do so we can potentially get started for 2.7.

@sirinoks
Copy link
Contributor

sirinoks commented Jan 28, 2022

Custom embeding
Docs
It seems that a parser should recognize a twitch stream/video link and replace it with an embed of such format:

<iframe
    src="https://player.twitch.tv/?<channel, video, or collection>&parent=streamernews.example.com"
    height="<height>"
    width="<width>"
    allowfullscreen="<allowfullscreen>">
</iframe>

RSS:
There is no official twitch RSS, however there is this
https://twitchrss.appspot.com/

@sirinoks
Copy link
Contributor

I am trying to find an example of how the youtube one was implemented to use as a reference. I can't find the PR/Issue though. Could someone show me where it is?

@humphd
Copy link
Contributor

humphd commented Jan 28, 2022

cc @dbelokon, who wrote it all.

@AmasiaNalbandian
Copy link
Contributor Author

These might help:
Add backend and API functionality for uploaded videos
Show videos in the main timeline

They are the PRs she created to get the code in.

@dbelokon
Copy link
Contributor

RSS:
There is no official twitch RSS, however there is this
https://twitchrss.appspot.com/

This is perfect! It seems we can fork the project and use it in Telescope, as it uses Apache License, version 2.0, as long as we respect the License. Here's a TL;DR of the license. However, I would like to hear from @humphd for the final decision, as he is familiar with working with different open source licenses.

For the embedding, I think we can use a module like react-twitch-embed, as it is easier to deal with in React.

@humphd
Copy link
Contributor

humphd commented Jan 28, 2022

If you want to use that app, someone needs to fix lzeke0/TwitchRSS#18 upstream so we can pull and run their app as a container.

@sirinoks
Copy link
Contributor

@dbelokon Could show to me where is the main part of the code that makes youtube work?

@dbelokon
Copy link
Contributor

dbelokon commented Jan 29, 2022

@sirinoks, there is not a specific part on how the YouTube works, as it is treated like another RSS feed (thanks to the suggestions that Dave mentioned back in the review of the PR), so I can write a small guide on how the code ended up:

  • First, in src/backend, I made a few changes to the processor.js so that it can parse the feed given by YouTube. I simply added a few properties for the parser to look for. After this, these articles given by the feed are converted to Posts, which then get saved to the redis database.
  • The other important change was modifying the posts service so that it could add an extra property to the JSON responses. The extra property defines whether the given post is either a blogpost or a video. This is used in the front end.
  • In the front end, I check which posts are videos, so I can place the embedded video player with the link of the post.

As you can see from the summary, I didn't do a huge rewrite to the backend, which is a big benefit~

Lemme know if you have any other questions 😄

@humphd
Copy link
Contributor

humphd commented Jan 29, 2022

https://hub.docker.com/r/rssbridge/rss-bridge/ is a more full-featured RSS bridge that is already containerized

@dbelokon dbelokon mentioned this issue Feb 1, 2022
8 tasks
@AmasiaNalbandian AmasiaNalbandian removed their assignment Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants