From 7893fec24273571ba0d7f3cf9950b66641bf210c Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Sat, 2 Oct 2021 13:36:55 -0500 Subject: Refactor bridges --- bridges/twitter.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 bridges/twitter.js (limited to 'bridges/twitter.js') diff --git a/bridges/twitter.js b/bridges/twitter.js new file mode 100644 index 0000000..e9855cb --- /dev/null +++ b/bridges/twitter.js @@ -0,0 +1,12 @@ +function get_twitter() { + let url = window.location.href; + 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 [] +} + -- cgit v1.2.3