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

Add bitcast peertube instance and load lightning data from support fields #521

Merged
merged 2 commits into from
Jan 17, 2022
Merged
Changes from all commits
Commits
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
7 changes: 5 additions & 2 deletions src/extension/content-script/batteries/Peertube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ interface PeertubeRes {
channel: {
displayName: string;
description: string;
support: string | null;
avatar: {
path: string;
};
};
description: string;
support: string | null;
}

// add more peertube URLs to this regex
const urlMatcher = /^https?:\/\/(bitcointv\.com)\/w\/.*/i;
const urlMatcher = /^https?:\/\/(bitcointv\.com|www\.bitcast\.online)\/w\/.*/i;

const battery = (): void => {
const hostMatch = document.location.toString().match(urlMatcher);
Expand Down Expand Up @@ -44,9 +46,10 @@ const battery = (): void => {
const channelDescription = data.channel.description;
const icon = `https://${host}${data.channel.avatar.path}`;
const episodeDescription = data.description;
const support = `${data.support} ${data.channel.support}`;

// we search in the episode or channel description for lightning data
const text = `${episodeDescription} ${channelDescription}`;
const text = `${episodeDescription} ${channelDescription} ${support}`;

let match;
let recipient;
Expand Down