Skip to content

Commit ac74773

Browse files
committed
Add Mastodon
Signed-off-by: Matt Friedman <maf675@gmail.com>
1 parent c586722 commit ac74773

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

collection/sites/mastodon.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Mastodon"
2+
host: mastodon.social
3+
example: https://mastodon.social/@HackerNewsBot/100181134752056592
4+
extract: "!//(?'host'[-.\\w]+)/@(?'name'\\w+)/(?'id'\\d+)!"
5+
oembed:
6+
endpoint: https://mastodon.social/api/oembed
7+
scheme: https://mastodon.social/@{@name}/{@id}
8+
scrape:
9+
- extract:
10+
url: "!https://(?'host'[-.\\w]+)/@(?'name'\\w+)/(?'id'\\d+)!"
11+
- match: "!^(?'origin'https://[^/]+)/@\\w+@[-.\\w]+/(?'id'\\d+)!"
12+
- url: "{@origin}/api/v1/statuses/{@id}"
13+
iframe:
14+
data-s9e-livepreview-ignore-attrs: "style"
15+
onload: "let c=new MessageChannel;c.port1.onmessage=e=>this.style.height=e.data+'px';this.contentWindow.postMessage('s9e:init','*',[c.port2])"
16+
width: "550"
17+
height: "300"
18+
src: https://s9e.github.io/iframe/2/mastodon.min.html#<xsl:value-of select="@name"/><xsl:if test="@host and@host!='mastodon.social'">@<xsl:value-of select="@host"/></xsl:if>/<xsl:value-of select="@id"/>

0 commit comments

Comments
 (0)