sindresorhus / Actions

⚙️ Supercharge your shortcuts
https://sindresorhus.com/actions
MIT License
2.58k stars 109 forks source link

Action proposal: Get Description or Other Meta Tag Contents from URL #146

Open nweii opened 1 year ago

nweii commented 1 year ago

Description

I'm trying to build a shortcut that can save Twitter / X URLs in markdown format without needing to access the Twitter API, and would find it helpful if I could retrieve the tweet details from the URL's <meta content="{tweet excerpt}" property="og:description"> tag.

Ideally, my final output using this shortcut would let me save a tweet in this format:

[{Author name} on X]({Tweet URL}):
> {Tweet content}

Even better would be an action with settings to specify what details to retrieve from an URL's meta tags based on other details present in the tag (ex. retrieve content="" from within a tag based on a specified property=""). But I imagine that keeping it focused to description tags is easier?

sindresorhus commented 1 year ago

How about an action that returns all meta tags as an dictionary? I think that would be the most flexible.

<meta content="{tweet excerpt}" property="og:description"> => ["og:description": "{tweet excerpt}"]

nweii commented 1 year ago

That sounds perfect!