Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Add Hashtag support #9

Open
tsmethurst opened this issue Aug 8, 2022 · 0 comments
Open

[feature] Add Hashtag support #9

tsmethurst opened this issue Aug 8, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@tsmethurst
Copy link

tsmethurst commented Aug 8, 2022

Many implementations (like Mastodon) use the Hashtag type for hashtags, but we don't support this yet.

A Note with a Mastodon style hashtag in it looks like this:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "ostatus": "http://ostatus.org#",
      "atomUri": "ostatus:atomUri",
      "inReplyToAtomUri": "ostatus:inReplyToAtomUri",
      "conversation": "ostatus:conversation",
      "sensitive": "as:sensitive",
      "toot": "http://joinmastodon.org/ns#",
      "votersCount": "toot:votersCount",
      "Hashtag": "as:Hashtag"
    }
  ],
  "id": "https://mastodon.online/users/FediFollows/statuses/108556046579308599",
  "type": "Note",
  "summary": null,
  "inReplyTo": null,
  "published": "2022-06-28T16:30:16Z",
  "url": "https://mastodon.online/@FediFollows/108556046579308599",
  "attributedTo": "https://mastodon.online/users/FediFollows",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "cc": [
    "https://mastodon.online/users/FediFollows/followers",
    "https://gts.superseriousbusiness.org/users/gotosocial"
  ],
  "sensitive": false,
  "atomUri": "https://mastodon.online/users/FediFollows/statuses/108556046579308599",
  "inReplyToAtomUri": null,
  "conversation": "tag:mastodon.online,2022-06-28:objectId=63614708:objectType=Conversation",
  "content": "<p>GoToSocial is a new free open Fediverse platform which runs on cheap lightweight hardware and emphasises user safety and privacy. You can follow at:</p><p>➡️ <span class=\"h-card\"><a href=\"https://gts.superseriousbusiness.org/@gotosocial\" class=\"u-url mention\">@<span>gotosocial</span></a></span> </p><p>It supports both blocklists and allowlists, block/allowlist imports, non-federated instances etc</p><p>It&#39;s still in alpha testing, you can find out more info at <a href=\"https://docs.gotosocial.org\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span class=\"invisible\">https://</span><span class=\"\">docs.gotosocial.org</span><span class=\"invisible\"></span></a></p><p>The project&#39;s souce is at <a href=\"https://github.com/superseriousbusiness/gotosocial\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">github.com/superseriousbusines</span><span class=\"invisible\">s/gotosocial</span></a></p><p><a href=\"https://mastodon.online/tags/GoToSocial\" class=\"mention hashtag\" rel=\"tag\">#<span>GoToSocial</span></a> <a href=\"https://mastodon.online/tags/Fediverse\" class=\"mention hashtag\" rel=\"tag\">#<span>Fediverse</span></a> <a href=\"https://mastodon.online/tags/ActivityPub\" class=\"mention hashtag\" rel=\"tag\">#<span>ActivityPub</span></a> <a href=\"https://mastodon.online/tags/FOSS\" class=\"mention hashtag\" rel=\"tag\">#<span>FOSS</span></a> <a href=\"https://mastodon.online/tags/FLOSS\" class=\"mention hashtag\" rel=\"tag\">#<span>FLOSS</span></a> <a href=\"https://mastodon.online/tags/Libre\" class=\"mention hashtag\" rel=\"tag\">#<span>Libre</span></a> <a href=\"https://mastodon.online/tags/FreeSoftware\" class=\"mention hashtag\" rel=\"tag\">#<span>FreeSoftware</span></a> <a href=\"https://mastodon.online/tags/OpenSource\" class=\"mention hashtag\" rel=\"tag\">#<span>OpenSource</span></a> <a href=\"https://mastodon.online/tags/SelfHosting\" class=\"mention hashtag\" rel=\"tag\">#<span>SelfHosting</span></a></p>",
  "contentMap": {
    "en": "<p>GoToSocial is a new free open Fediverse platform which runs on cheap lightweight hardware and emphasises user safety and privacy. You can follow at:</p><p>➡️ <span class=\"h-card\"><a href=\"https://gts.superseriousbusiness.org/@gotosocial\" class=\"u-url mention\">@<span>gotosocial</span></a></span> </p><p>It supports both blocklists and allowlists, block/allowlist imports, non-federated instances etc</p><p>It&#39;s still in alpha testing, you can find out more info at <a href=\"https://docs.gotosocial.org\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span class=\"invisible\">https://</span><span class=\"\">docs.gotosocial.org</span><span class=\"invisible\"></span></a></p><p>The project&#39;s souce is at <a href=\"https://github.com/superseriousbusiness/gotosocial\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">github.com/superseriousbusines</span><span class=\"invisible\">s/gotosocial</span></a></p><p><a href=\"https://mastodon.online/tags/GoToSocial\" class=\"mention hashtag\" rel=\"tag\">#<span>GoToSocial</span></a> <a href=\"https://mastodon.online/tags/Fediverse\" class=\"mention hashtag\" rel=\"tag\">#<span>Fediverse</span></a> <a href=\"https://mastodon.online/tags/ActivityPub\" class=\"mention hashtag\" rel=\"tag\">#<span>ActivityPub</span></a> <a href=\"https://mastodon.online/tags/FOSS\" class=\"mention hashtag\" rel=\"tag\">#<span>FOSS</span></a> <a href=\"https://mastodon.online/tags/FLOSS\" class=\"mention hashtag\" rel=\"tag\">#<span>FLOSS</span></a> <a href=\"https://mastodon.online/tags/Libre\" class=\"mention hashtag\" rel=\"tag\">#<span>Libre</span></a> <a href=\"https://mastodon.online/tags/FreeSoftware\" class=\"mention hashtag\" rel=\"tag\">#<span>FreeSoftware</span></a> <a href=\"https://mastodon.online/tags/OpenSource\" class=\"mention hashtag\" rel=\"tag\">#<span>OpenSource</span></a> <a href=\"https://mastodon.online/tags/SelfHosting\" class=\"mention hashtag\" rel=\"tag\">#<span>SelfHosting</span></a></p>"
  },
  "attachment": [],
  "tag": [
    {
      "type": "Mention",
      "href": "https://gts.superseriousbusiness.org/users/gotosocial",
      "name": "@gotosocial@superseriousbusiness.org"
    },
    {
      "type": "Hashtag",
      "href": "https://mastodon.online/tags/selfhosting",
      "name": "#selfhosting"
    },
    {
      "type": "Hashtag",
      "href": "https://mastodon.online/tags/opensource",
      "name": "#opensource"
    },
    {
      "type": "Hashtag",
      "href": "https://mastodon.online/tags/freesoftware",
      "name": "#freesoftware"
    },
    {
      "type": "Hashtag",
      "href": "https://mastodon.online/tags/libre",
      "name": "#libre"
    },
    {
      "type": "Hashtag",
      "href": "https://mastodon.online/tags/floss",
      "name": "#floss"
    },
    {
      "type": "Hashtag",
      "href": "https://mastodon.online/tags/foss",
      "name": "#foss"
    },
    {
      "type": "Hashtag",
      "href": "https://mastodon.online/tags/activitypub",
      "name": "#activitypub"
    },
    {
      "type": "Hashtag",
      "href": "https://mastodon.online/tags/fediverse",
      "name": "#fediverse"
    },
    {
      "type": "Hashtag",
      "href": "https://mastodon.online/tags/gotosocial",
      "name": "#gotosocial"
    }
  ],
  "replies": {
    "id": "https://mastodon.online/users/FediFollows/statuses/108556046579308599/replies",
    "type": "Collection",
    "first": {
      "type": "CollectionPage",
      "next": "https://mastodon.online/users/FediFollows/statuses/108556046579308599/replies?only_other_accounts=true&page=true",
      "partOf": "https://mastodon.online/users/FediFollows/statuses/108556046579308599/replies",
      "items": []
    }
  }
}

According to the ActivityStreams spec, this is not an official type: https://www.w3.org/TR/activitystreams-vocabulary/#microsyntaxes

But since it seems to be widely adopted, we should try to support it as well.

@tsmethurst tsmethurst added the enhancement New feature or request label Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant