aboutsummaryrefslogtreecommitdiff
path: root/twitter.js
diff options
context:
space:
mode:
authorMark Powers <markppowers0@gmail.com>2020-11-23 20:21:59 -0600
committerMark Powers <markppowers0@gmail.com>2020-11-23 20:21:59 -0600
commitc5cf1359762274a17fb139944405c02618996700 (patch)
tree69e48f19a6d187eccb8cc50740aadf534781a0de /twitter.js
parenta0dad259a6c767487be08afc666dbf2c923a6e25 (diff)
Fix youtube feeds
Diffstat (limited to 'twitter.js')
-rw-r--r--twitter.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/twitter.js b/twitter.js
new file mode 100644
index 0000000..1f21047
--- /dev/null
+++ b/twitter.js
@@ -0,0 +1,10 @@
+function get_twitter(url) {
+ let pattern = /twitter.com\/(\w+).*/
+ 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)
+ }
+ return []
+}