aboutsummaryrefslogtreecommitdiff
path: root/content_scripts/bridges
diff options
context:
space:
mode:
authorMark Powers <mark@marks.kitchen>2022-12-30 13:58:20 -0600
committerMark Powers <mark@marks.kitchen>2022-12-30 13:58:20 -0600
commit3bdc11a9b2c78f2be8c11d28befce7328b6e5424 (patch)
tree98a88b435bf14f71a28537a0e5c8e052ab58a78c /content_scripts/bridges
parentb5c10718ddeaa8fcac368515ca150705b1a2c5ab (diff)
Improve RSS preview
Diffstat (limited to 'content_scripts/bridges')
-rw-r--r--content_scripts/bridges/instagram.js2
-rw-r--r--content_scripts/bridges/twitter.js10
-rw-r--r--content_scripts/bridges/youtube.js9
3 files changed, 14 insertions, 7 deletions
diff --git a/content_scripts/bridges/instagram.js b/content_scripts/bridges/instagram.js
index 0ced06a..18988b9 100644
--- a/content_scripts/bridges/instagram.js
+++ b/content_scripts/bridges/instagram.js
@@ -7,4 +7,4 @@ async function get_insta() {
let feed_url = `${base_url}/?action=display&bridge=Instagram&context=Username&u=${uid}&media_type=all&format=`;
return get_all_types(feed_url)
}
-
+register(["instagram"], get_insta)
diff --git a/content_scripts/bridges/twitter.js b/content_scripts/bridges/twitter.js
index e9855cb..1ffa131 100644
--- a/content_scripts/bridges/twitter.js
+++ b/content_scripts/bridges/twitter.js
@@ -4,9 +4,15 @@ function get_twitter() {
let match = url.match(pattern);
if (match) {
let twitter_handle = match[1]
+
let feed_url = `${base_url}/?action=display&bridge=Twitter&context=By+username&u=${twitter_handle}&format=`
- return get_all_types(feed_url)
+ let feeds = get_all_types(feed_url)
+
+ let feed_url_norep = `${base_url}/?action=display&bridge=Twitter&context=By+username&u=${twitter_handle}&norep=on&format=`
+ let feeds_norep = get_all_types(feed_url, "no replies")
+
+ return feeds.concat(feeds_norep)
}
return []
}
-
+register(["twitter"], get_twitter)
diff --git a/content_scripts/bridges/youtube.js b/content_scripts/bridges/youtube.js
index 202873b..e6b584c 100644
--- a/content_scripts/bridges/youtube.js
+++ b/content_scripts/bridges/youtube.js
@@ -31,7 +31,7 @@ async function get_youtube() {
let patternListInVideo = /youtube.com\/watch\?v=\w+\&list=(\w+)/
let matchListInVideo = url.match(patternListInVideo)
- if(matchListInVideo){
+ if(matchListInVideo && matchListInVideo[1]){
let playlistId = matchListInVideo[1]
let playlist_feed_url = `${base_url}/?action=display&bridge=Youtube&context=By+playlist+Id&p=${playlistId}&duration_min=&duration_max=&format=`
let native_url = get_native_playlist_feed(playlistId)
@@ -41,17 +41,17 @@ async function get_youtube() {
return feeds
}
- if (matchUser) {
+ if (matchUser && matchUser[1]) {
let user = matchUser[1];
let feed_url = `${base_url}/?action=display&bridge=Youtube&context=By+username&u=${user}&duration_min=&duration_max=&format=`
return get_all_types(feed_url)
}
- if (matchChannel) {
+ if (matchChannel && matchChannel[1]) {
let channelId = matchChannel[1]
let feed_url = `${base_url}/?action=display&bridge=Youtube&context=By+channel+id&c=${channelId}&duration_min=&duration_max=&format=`
return get_all_types(feed_url)
}
- if (matchPlaylist) {
+ if (matchPlaylist && matchPlaylist[1]) {
let playlistId = matchPlaylist[1]
let native_url = get_native_playlist_feed(playlistId)
let feed_url = `${base_url}/?action=display&bridge=Youtube&context=By+playlist+Id&p=${playlistId}&duration_min=&duration_max=&format=`
@@ -61,3 +61,4 @@ async function get_youtube() {
return []
}
+register(["youtube"], get_youtube)