diff options
author | Mark Powers <mark@marks.kitchen> | 2021-10-02 13:36:55 -0500 |
---|---|---|
committer | Mark Powers <mark@marks.kitchen> | 2021-10-02 13:36:55 -0500 |
commit | 7893fec24273571ba0d7f3cf9950b66641bf210c (patch) | |
tree | c78df61028d814e2bbb437b90ac393989f0208ec /bridges/twitter.js | |
parent | a1fbc4ac46e1c41d8c4522ae2b7af402ba0515f7 (diff) |
Refactor bridges
Diffstat (limited to 'bridges/twitter.js')
-rw-r--r-- | bridges/twitter.js | 12 |
1 files changed, 12 insertions, 0 deletions
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 [] +} + |