diff options
Diffstat (limited to 'twitter.js')
-rw-r--r-- | twitter.js | 10 |
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 [] +} |