Releases: snarfed/granary
Releases · snarfed/granary
v9.0
Breaking changes:
mastodon: Switch AS1 actor and object ids fromtag:URIs to the real AS2 ids.
Non-breaking changes:
as1:prefix_urls: handle string values.is_public: returnFalsefor public CRUD activities on non-public objects.is_dm/recipient_if_dm: allow DMs with recipient inccinstead ofto; evidently NeoDB sends DMs like this.targets: add quoted posts, ie attachments withobjectType: note.- Add new
quoted_posts,mentionsfunctions.
as2:- Add support for pinned posts via the
featuredcollection. - Handle
repliesas a collection in bothfrom_as1andto_as1. from_as1:- Add
rel="tag"to hashtag HTML links andclass="h-card"to mentions incontentto prevent Mastodon from generating link previews for them.
- Add
to_as1:- Handle bare string
attachmentvalues. - Handle multiply-valued
type.
- Handle bare string
is_server_actor: returnFalsefor id URLs with query parameters.- Add new
URL_REconstant.
- Add support for pinned posts via the
bluesky:- Add
pds_url,**requests_kwargskwargs toBlueskyconstructor. - Convert
followersCount/followsCountinapp.bsky.actor.defs#profileViewDetailedto the non-standardfollowersandfollowingAS1 collections (borrowed from ActivityPub). - Convert pinned posts (just one per actor) between Bluesky's
pinnedPostfield and the fediverse'sfeaturedcollection. - Switch
getFollows/getFollowerscalls from PDS to AppView. (These requests to Bluesky PDSes were timing out connection from Google Cloud IPs as of 2025-05-08.) from_as1:- If
contentis in a language that doesn't delimit words by spaces, truncate between any characters (snarfed/bridgy-fed#1625). - Bug fix: handle bare string
image. - Bug fix for when last line of content is a bsky.app URL that's not a post (bridgy-fed#2064).
- If
to_as1:- Bug fix, handle facets with bad indices (in the middle of Unicode code points) interacting with HTML characters.
- Better error handling when embed record
$typeis invalid.
web_url_to_at_uriandBSKY_APP_URL_RE: tighten validation, check authority and rkey for allowed characters.
- Add
mastodon:- Convert
followers_count/following_countin Mastodon accounts to the non-standardfollowersandfollowingAS1 collections (borrowed from ActivityPub). - Add
**requests_kwargstoBlueskyconstructor.
- Convert
microformats2:from_as1: for quote posts (note attachments), populate theiridintourl, notuid(bridgy-fed#2045).to_as1:- Bug fix: handle
u-bookmark-of h-cite(#918). - Only populate
u-urlintourlif it's a valid URL.
- Bug fix: handle
nostr:- Add new
nip05_to_npubfunction to resolve NIP-05 identifiers. - Add new
bech32_decode,bech32_encode,bech32_prefix_for,pubkey_from_privkey,uri_forfunctions. - Add new
verifyfunction to verify event signatures. - Add NIP-24 support for additional tags and fields in profiles.
- Add NIP-92/94 support for
imetatags for images, video, audio. from_as1:- Add optional new
privkeykwarg to sign output events and populatepubkeywith. - Add optional new
from_protocolkwarg for setting NIP-48proxytags in output events. - When converting
created_attopublished, include UTC timezone. - When converting actors to kind 0 Nostr events, remove unset fields from content instead of setting them to null, and only use
_NIP-05 username with full domains. - Don't escape Unicode characters (background).
- Convert HTML
contentto Markdown plain text.
- Add optional new
Nostr:- Add new
user_urlmethod. - Add optional new
privkeykwarg to constructor to sign events with; removepubkeykwarg. createnow signs activities before sending to relays. Now requires theprivkeymember attribute to be set.query:- Verify signatures; discard events with invalid signatures.
- Add NIP-42 support; reply to
AUTHchallenges with signatures from the storedprivkey.
- Add new
- Add new
rss:to_as1: handle UNIX timestampdcterms:modifiedvalues without overflowing.
v8.1:
Notable changes
as2:- Add new
set_contentfunction to help keepcontentandcontentMapin sync. to_as1: support integer secondsduration, which is non-standard but sent by some AP implementations, eg Funkwhale.link_tags: addclass="hashtag"for hashtag (Tag,Hashtag) tags (bridgy-fed/#1634).
- Add new
bluesky:- Translate Bluesky
app.bsky.feed.post#tagsto/from AS1tags(snarfed/bridgy-fed#1394). - Add
authkwarg toBlueskyconstructor to pass through as custom auth object torequests.get/post. from_as1:- Bug fix for generating external embeds: convert HTML
content/summaryto plain textdescription(bridgy-fed#1615). - Don't add
app.bsky.feed.post#tagsthat are overmaxGraphemes(64). - Add new
raise_kwarg to raiseValueErrorif a required object (eg the target of a like or repost) can't be fetched via ATProto. - Bug fix: ignore
inReplyTofor DMs. - Don't convert HTML links in
contentwith bad URLs to#linkfacets.
- Bug fix for generating external embeds: convert HTML
to_as1:- Bug fix: HTML-escape
<and>characters, while preserving facet indices, so that they don't disappear (snarfed/bridgy-fed#1144).
- Bug fix: HTML-escape
preview/create:- Add support for follows.
to_external_embed: bug fix: handle compositeurlfield.
- Translate Bluesky
mastodon:preview/create:- Add support for follows.
nostr:- Add new
Nostr.deletemethod. - Add new
signfunction.
- Add new
source:Source.postprocess_object: relax mention text matching withmentions=True, ignore server part of webfinger addresses.- Add new
get_followsandget_followersmethods, implement in Mastodon and Bluesky.
v8.0
Breaking changes:
as2:from_as1: InLinkobjects (includingTags andMentions), converturltohref. Before this, we left it asurl, which was incorrect AS2.
Non-breaking changes:
Standardize function and method names in all modules to to_as1, from_as, etc. Old method names are now deprecated but won't be removed until at least v9.0, if not later.
as1:- Add new
is_dm,recipient_if_dm,get_id, andis_audiencefunctions.
- Add new
as2:- Add
sensitive,indexable, anddiscoverablesupport. - Add new
is_server_actorfunction (FEP-d556, discussion). from_as1:- Always convert images to objects with
type: Image, never to bare string URLs (bridgy-fed#/1000). - Bug fixes for converting links to facets when the link text is the link URL.
- Always convert images to objects with
to_as1:- Handle other types of tags better, eg non-standard
Hashtagand innertagfield for name. - Bug fix for videos,
mimeTypegoes in outer object, not instream. - Bug fix for
to/ccwith mixed dict and string elements.
- Handle other types of tags better, eg non-standard
link_tags: addclass="mention"forMentiontags (bridgy-fed/#887).
- Add
atom:atom_to_activity/ies: Get URL fromlinkfor activities as well as objects. (Thanks @imax9000!)
bluesky:- Translate Bluesky
app.bsky.feed.post#langsto/from AS1contentMap(which isn't officially part of AS1; we steal it from AS2). - Translate AS2
sensitiveon posts to Blueskygraphic-mediaself label, and many Bluesky self labels back tosensitivewith content warning(s) insummary. - Translate AS1/2 DMs to/from Bluesky chats.
- Translate video embeds in posts.
create/previewCreate:- If
inReplyToisn't a Bluesky URL or AT URI, returnCreationResultinstead of raisingValueError.
- If
from_as1:- Convert
articles to external embeds with no post text. - Add new
as_embedboolean kwarg to do the same thing for any object. - When truncating and adding a link to the original post, use
idifurlis not available (snarfed/bridgy-fed#1155). - If the input object has
inReplyToorobjectortargetwith no recognizable ATProto or Bluesky object, raiseValueError. - Omit images that aren't in
blobs. - Bug fix for quote posts with text content that's longer than Bluesky's limit (snarfed/bridgy-fed#1197).
- When a
flaghas multiple objects, use the first one that's an ATProto record. - Handle URLs more carefully, don't add link facets with invalid
uris. - Populate
blobsinto external embedthumbs. - Parse image blobs and add
aspectRatioto image record. - Bug fix: handle HTML links with
titleincontentcorrectly. - Bug fix: handle attachments with no
idorurl.
- Convert
to_as1:- Extract links from
app.bsky.actor.profile#descriptionand#summaryintourl/urlsfields. - Bug fix: first URL (singular) goes in
url, list of URLs goes inurls. - Bug fix: handle hashtags with regexp special characters.
- Support string and bytes CIDs in blob
refs as well asCIDinstances. - Link hashtags to bsky.app hashtag search pages (bridgy-fed#1634).
- Extract links from
Bluesky.get_activities: skip unknown record types instead of raisingValueError.
- Translate Bluesky
microformats2:object_to_json: Improve handling of items with multiple types by removinginReplyTofrom likes, shares, etc (snarfed/bridgy-fed#941).to_as1: don't crash on integer UNIX timestamps inpublishedandupdated.
rss:- Support image enclosures, both directions.
from_as1:- Bug fix: remove use of default
authorvalue'-'since RSS spec requires author values to include valid email addresses.
- Bug fix: remove use of default
source:Source.postprocess_object: add newfirst_link_to_attachmentboolean kwarg to fetch and generate a previewattachmentfor the first link in the HTMLcontent, if any.
v7.0
Breaking changes:
jsonfeed:jsonfeed_to_activities: return AS1 objects, not activities.
Non-breaking changes:
as1:activity_changed: adddisplayName,summaryfields.is_public: returnFalseif the object/activity containstothat's empty or has only unknown aliases.
as2:- Add support for the
Application,Block,Flag, andLinktypes. - Generalize actor logic in
to/from_as1across all actor types, not justPerson. - Add new
link_tagsfunction.
- Add support for the
atom:activities_to_atom: handle image attachments withouturlfield.
bluesky:to_as1:- Add support for:
app.bsky.embed.recordapp.bsky.embed.recordWithMediaapp.bsky.feed.defs#notFoundPostapp.bsky.feed.generatorapp.bsky.graph.blockapp.bsky.graph.listapp.bsky.graph.listitemcom.atproto.admin.defs#repoRefcom.atproto.moderation.createReport#inputcom.atproto.repo.strongRef
- Add hashtag facet support.
- Convert blobs in embeds to
getBlobimage URLs. app.bsky.actor.profile: add HTML links for URLs insummary(snarfed/bridgy-fed#1065).- Escape HTML characters (
<,>,&) inapp.bsky.actor.profiledescriptionfield. - Bug fix for
create/updateactivities with bare stringobject.
- Add support for:
from_as1:- Add hashtag, mention, block, and flag support. Interpret
tagswith missingobjectTypeas hashtags. - Guess missing indices in facets based on content text. Otherwise, if we still don't know a facet's indices, discard it.
- Extract HTML links ( tags) from HTML content and convert to link facets (snarfed/bridgy-fed#976).
- If an output string value is longer than its
maxGraphemesormaxLengthin its lexicon, truncate it with an…ellipsis character at the end in order to fit. If this happens to post text, include a link embed pointing to the original post. - If the object has a video, include an external embed pointing to the original post and mark it as
[Video](snarfed/bridgy-fed#1078). - If the object has images, add the original post link to the end of the text, since Bluesky doesn't support both image and external embeds in the same post (bluesky-social/atproto#2575, snarfed/bridgy-fed#1106).
- If a
notehassummary- often used for content warnings in the fediverse - add it tocontentas a prefix instead of overridingcontent(snarfed/bridgy-fed#1001). - Populate
reply.rootproperly in reply posts (snarfed/bridgy#1696). - Add new
original_fields_prefixkwarg to store original data in custom (off-Lexicon)*OriginalDescriptionand*OriginalUrlfields inapp.bsky.actor.profileand*OriginalTextand*OriginalUrlfields inapp.bsky.feed.post(snarfed/bridgy-fed#1092). - Support
lexrpc.Clientas well asBlueskyforclientkwarg.
- Add hashtag, mention, block, and flag support. Interpret
from_as1_to_strong_ref:- Add
valueboolean kwarg. - Change
clientkwarg fromBlueskytolexrpc.Client.
- Add
microformats2:- Generalize actor logic across all actor types, not just
person. json_to_object:- Strip leading
#prefix (if present) from hashtagu-categorys. - Bug fix for when
nameproperty is an object, eg anh-card.
- Strip leading
object_to_json:- Convert both
idandurlinsideinReplyTotoin-reply-to.
- Convert both
- Generalize actor logic across all actor types, not just
nostr:- Handle connection closing while sending initial query.
source:Source.postprocess: when extracting @-mentions, defer to existing tag if it has the samedisplayNameand hasurl.
v6.2:
Notable changes
as1:get_ownerbug fix forpost,update,deleteactivities.activity_changed: add newinReplyTokwarg.is_public: add newunlistedkwarg.
as2:to_as1: bug fix, preserveobjectType: featuredfor banner/header images even whenmediaTypeis also set.is_public: add newunlistedkwarg.from_as1:- For
iconfield, prefer image types that are allowed by Mastodon. - Bug fix, handle
stop-followingwith stringobjectid.
- For
atom:- Add new
extract_entriesfunction. activity_to_atom: default actor/author name to username.atom_to_activities: support top-levelentryelement as well asfeed.atom_to_*:- add
object.author - default
objectTypetoarticle/noteandverbtopost - convert
link rel=self/alternatetourl - use
displayNamein objects instead oftitle - Interpret entry
linkwithoutrelas self link.
- add
- If
entry.authordoesn't have id or url, default them to feed author's.
- Add new
bluesky:- Implement
createandpreview. - Fully support both
recordandobjecttypes infrom_as1andto_as1. Useto_as1'stypekwarg andfrom_as1'sout_typekwarg to disambiguate. - Implement
Bluesky.post_id. - Add new
blob_to_urlfunction. - Delete
as1_to_profile, switchfrom_as1to return$type: app.bsky.actor.profile. - Convert HTML
summaryandcontentto plain text. - Implement
Bluesky.user_to_actor,Bluesky.get_actor. - Don't log in (fetch an access token) eagerly in the constructor; wait until the client makes a call.
- Prefer DID to handle in API calls that accept either.
at_uri_to_web_url: support lists.web_url_to_at_uri: convert profile URLs likehttps://bsky.app/profile/snarfed.orgto profile record URIs (at://snarfed.org/app.bsky.actor.profile/self) instead of repo URIs (at://snarfed.org).- Add
from_as1_to_strong_ref. - Allow
:s in record keys (atproto#2224). to_as1:- Convert blobs, both new and old style, to PDS
getBlobURLs. - Add new
urikwarg. - Translate
handletousername, add newrepo_handlekwarg. - Add support for
app.bsky.feed.repost,app.bsky.graph.defs#listView,app.bsky.feed.defs#blockedPost. - Add
actor/authorbased onrepo_did. - Improve
urlfield: include custom handles, only userepo_did/handleforapp.bsky.actor.profile. - Handle bad facet indices that point inside Unicode code points (example; discussion).
- Convert
!no-unauthenticatedlabel on profiles to AS1@unlistedaudience target (bridgy-fed#828).
- Convert blobs, both new and old style, to PDS
from_as1:- Add
out_typekwarg to specify desired output type, egapp.bsky.actor.profilevsapp.bsky.actor.defs#profileViewBasicvsapp.bsky.actor.defs#profileView. - Add
blobskwarg to provide blob objects to use for image URLs. - Add
clientkwarg to fetch and populate CIDs. - Handle mention tags pointing to bare DIDs.
- Use
parentasrootin replies. (Technically wrong in cases where the parent isn't the root, but we don't actually know the root. 🤷) - Bug fix: handle bare string URLs in
imagefield. - Bug fix: handle tags without
urlfield. - Strip trailing slash from home page URLs in order to remove visible
/from rel-me verified links on Mastodon etc. - Convert
attributedToto singular if it has only one element. - If
nameisn't set, fall back topreferredUsernameor infer Webfinger handle fromidorurl. - Prioritize bsky.app profile URL before handle URL in
urlfield (bridgy#1640). - Convert
bsky.appinReplyToURLs toat://URIs. - Tighten up
datetimeconversion to match the ATProto recommended format.
- Add
- Implement
facebook:- Remove
Facebook.fql_stream_to_post. Facebook turned down FQL in 2016.
- Remove
github:- When converting data to AS1, use
displayNamein objects instead oftitle.
- When converting data to AS1, use
mastodon:get_activitiesbug fix: use query params for/api/v1/notificationsAPI call, not JSON body.- Convert HTTP 200 responses with
errorJSON field (eg from Sharkey) to 400/401 exceptions. - Prefer
media_attachments.remote_urlwhen available since it may be more long-lived thanurlfor remote statuses (bridgy#1675).
microformats2:object_to_jsonbug fix: handle singularinReplyTo.json_to_objectbug fix: handle list-valuedlocation.
nostr:get_*: return partial results when the websocket connection is closed prematurely.to_as1: handle invalid NIP05 values (eg{})
rss:to_activities:- Use
objectType: noteiftitleisn't set or is a prefix (possibly ellipsized) ofcontent/description. - Add support for images in
media:contenttags (#674).
- Use
Source:postprocess_activity/object: addmentionskwarg to convert @-mentions in HTML links tomentiontags.
v6.1:
Notable changes
Nostr, Bluesky get_activities, lots of improvements in as2 and microformats2, and more!
REST API breaking changes:
Twitter is dead, at least in the REST API.
Non-breaking changes:
- Add new
nostrmodule! as1:- Add
get_owner,targets. - Add
accept,reject,stop-followingtoVERBS_WITH_OBJECTand removerepost, it's not an AS1 verb. - Handle
urlfield list values (even though it's invalid AS1).
- Add
as2:to_as1:- Improve
Videohandling: supportLinkobjects inurl, extract stream URLs and types from linktags. - Coerce non-float
latitudeandlongitudeto float, raiseValueErroron failure. - Put image attachments into
imageas well asattachments(bridgy-fed#429). - Handle Hubzilla's composite object attachment
values. - Bug fix for null
mediaTypeinattachmentandtags.
- Improve
- Add new
TYPES_WITH_OBJECTconstant. - Add new
get_urls,addressfunctions. - Improve
Content-Typecompatibility withapplication/ld+json; profile="https://www.w3.org/ns/activitystreams". - Bug fix for
Undoactivities with bare string idobjects. - Revise HTML in
PropertyValueattachments on actors to include full URL in anchro text to be compatible with Mastodon's profile link verification.
atom:activities_to_atometc:- Switch
contentfrom XHTML to HTML inside CDATA to support non-XHTML input content (bridgy-fed#624. - Bug fix, handle bare string URL
imagevalues. - Bug fix, emove incorrect
type="application/atom+xml"fromrel="self"linkinentry. - Render
objectType: commentattachments. - Remove invalid
<a>element for tags.
- Switch
- Bug fixes in
activity_to_atom/activities_to_atomfor dict-valuedurlfields. - Render images in article/note attachments.
- Render
objectType: serviceattachments, eg Bluesky custom feeds.
bluesky:- Implement
BlueskyAPI class, includingget_activities. - Drop bundled
app.bsky/com.atprotolexicons, use lexrpc's instead. - Convert reposts, quotes, inline links, attached links, and mentions, both directions. Includes Bluesky facet (rich text) support.
- Handle quote posts with attached images, both directions.
- Handle likes, both directions.
- Add new
web_url_to_at_urifunction. from_as1: handle link tags without start/end indices.to_as1:- Add new
typekwarg. - Generate staging.bsky.app profile and post URLs.
- Propagate profile
didinto actorid. - Add unimplemented stub for custom feeds, eg
app.bsky.feed.defs#generatorView.
- Add new
- Add
as1_to_profile. - Bug fix for converting follows, both directions:
subjectinapp.bsky.graph.followis followee, not follower. (That field is badly named!)
- Implement
jsonfeed:activities_to_jsonfeed:- Bug fix, handle bare string values for
imageandstream. - Bug fix: handle non-object
author.
- Bug fix, handle bare string values for
mastodon:status_to_object: add/fix alt text handling for images.
microformats2:json_to_html:- HTML-escape tag and quote attachment names. Fixes GHSA-4w4f-g49g-3f7j; thank you @janboddez!
json_to_object:- Improve handling of items with multiple types by using post type discovery more aggressively.
- Normalize ISO-8601 format of
publishedandupdatedtimestamps.
object_to_json:- Bug fix, handle bare string URL
imagevalues. - Normalize ISO-8601 format of
publishedandupdatedtimestamps. - Handle bare string ids for
repliesandshares(usually from AS2.)
- Bug fix, handle bare string URL
- Include
objectType: serviceattachments, eg Bluesky custom feeds, in JSON and HTML output.
rss:from_activities: handle bare string idauthor.
v6.0
Breaking changes
as2:- Interpret bare string
object,inReplyTo, etc values as ids, convert them to bare strings oridinstead ofurl.
- Interpret bare string
microformats2:- Convert simple string
in-reply-to,repost-of,like-ofetc values to AS1 bare strings orids instead ofurls.
- Convert simple string
Non-breaking changes
- Add new
blueskymodule for Bluesky/AT Protocol! as1:- Add the
organizationobject type andACTOR_TYPESconstant (based on AS2). - Add new
get_ids,get_object, andget_objectsfunctions.
- Add the
activity_changed: ignoreinReplyTo.author(snarfed/bridgy#1338)as2:- Support converting between AS1
stop-followingand AS2UndoFollow. - Support AS2
AcceptandRejectfor follows as well as event RSVPs. - Add support for the
Question(ie poll),Organization, andDeleteobject types. - Convert
to/ccto/from AS1tofor public and unlisted. - Handle
type: Documentvideo attachments like Mastodon emits. from_as1: bug fix for image objects withurlandvaluefields (for alt text).from_as1: bug fix, handle bare string URLimagevalues.from_as1: converturls.displayNametoattachment.name(bridgy-fed#331).from_as1: preserveinReplyToobject values as objects, inline single-element lists down down to just single element.to_as1: useobjectType: featuredfor first image inimagefield.to_as1: populateactorintoobject.authorforUpdates as well asCreates.to_as1: convert Mastodon profile metadataPropertyValueattachments tourlcomposite objects withdisplayName.- Preserve
toandccvalues when converting both directions.
- Support converting between AS1
atom:- Bug fix for rendering image attachments without
imagefield to Atom. - Bug fix for
publishedandupdatedin entries with objects, eg likes, reposts, RSVPs, bookmarks. Thanks @gregorlove! (#480) - Bug fix for content
activity/ies_to_atomwhenobjectis present and empty. - Bug fix for objects with elements without
objectTypein thetofield.
- Bug fix for rendering image attachments without
flickr:get_activities: add support for thecountkwarg.
github:get_activities: add support for thecountkwarg.
jsonfeed:- Switch from
white-space: preCSS to converting newlines to<br>s because some feed readers follow it strictly and don't even line wrap (#456).
- Switch from
mastodon:- Add compatibility support for Truth Social.
- Handle truncated JSON API responses.
microformats2:json_to_object: drop backward compatibility support forlikeandrepostproperties. Background discussion.json_to_object: add newrel_urlskwarg to allow attachingdisplayNames tourlsbased on HTML text ortitleattribute (bridgy-fed#331).- Add new
json_to_activitiesfunction. hcard_to_html/maybe_linked_name: whennameis missing, use pretty URL as visible text.- Support the
h-cardorgproperty. json_to_object: handle compositersvpproperty value.json_to_object: bug fix whenfetch_mf2is True, handle when we run the authorship algorithm and fetch an author URL that has au-photowithalt.
rss:from_activities: fix item ordering to match input activities.
v5.0:
Breaking changes
- Drop Python 3.6 support. Python 3.7 is now the minimum required version.
- Twitter, Instagram, Mastodon:
- Drop
get_activitiescachekwarg's support for App Engine memcache interface. It's now only used as a plaindict.get_activitieswill now make many small modifications, so if you pass an object that implements those as API calls, you'll probably want to batch those separately.
- Drop
- Twitter, Mastodon, Flickr, GitHub:
create/preview: support the AS1favoriteverb as well aslike. (bridgy#1345)
- Atom:
- Switch to converting AS1
id(instead ofurl) to Atomid.
- Switch to converting AS1
- Reddit:
- Implement
get_actor.
- Implement
- Mastodon:
create/preview: allow non-Mastodon replies, ie activities that includeinReplyToURLs even if none of them point to a toot. (bridgy#1321)- Raise
requests.HTTPErrorwithresponse.status_code502 instead ofJSONDecodeErroron non-JSON responses. This is synthetic, but more helpful for error handling.
- microformats2:
object_to_jsonand related functions: handle all escaped HTML entities, not just&<>.- Unify
microformats2.prefix_image_urlsandprefix_video_urlsinto a newas1.prefix_urlsfunction.
- RSS:
- Remove
itunes:category. It has to be one of Apple's explicit categories, which we aren't prepared to validate, so don't try.
- Remove
- ActivityStreams 2:
- Translate both
urlandurlsfrom AS1 into multi-valued AS2urlfield.
- Translate both
- Move a number of utility methods from the
Sourceclass to a newas1module:object_type,merge_by_id,is_public,add_rsvps_to_event,get_rsvps_from_event,activity_changed,append_in_reply_to,actor_name,original_post_discovery. as1.original_post_discovery: remove deprecatedcachekwarg.
Non-breaking changes
- ActivityStreams 2:
- Fix spec compliance bug:
iconandimageare singly valued, not multiply valued. - Add new
is_publicmethod andPUBLIC_AUDIENCEconstant. - Prefer
"objectType": "featured"first in theimagefield when converting from AS1, last in theiconfield. This matches the ActivityPub (Mastodon) convention of usingiconfor profile pictures andimagefor header images. - Propagate
urlvalues into newPropertyValueattachments onPersonobjects; these end up in Mastodon's "profile metadata" link fields. to_as1: if an attachment'smediaTypeisimage/..., overrideobjectTypeand set it toimage.
- Fix spec compliance bug:
- Twitter
- Trim alt text in line between post preview and creation
- Correctly trim Twitter alt text
- Facebook
- Scraping: extract post id and owner id from
data-ftattribute and_ft_query param more often instead ofstory_fbid, which is now an opaque token that changes regularly. (facebook-atom#27)
- Scraping: extract post id and owner id from
- Instagram
- Add new
Instagram.scraped_json_to_activitiesmethod.
- Add new
- GitHub
createandpreview: convert profile URLs to @-mentions, eghttps://github.com/snarfedto@snarfed(bridgy#1090).get_activitieswithactivity_idnow supportsfetch_repliesandfetch_likes.
- Reddit
- Add
cachesupport toget_activities.
- Add
- REST API
- Add new
/scrapedendpoint that acceptsPOSTrequests with silo HTML as input. Currently only supports Instagram. Requiressite=instagram,output=...(any supported output format), and HTML as either raw request body or MIME multipart encoded file in theinputparameter.
- Add new
- microformats2
- Add new
extraandbody_classkwargs toactivities_to_html. - When converting
u-featuredimages to AS1, add new non-standard"objectType": "featured"field to distinguish them fromu-photo. - Convert
p-noteto AS1summary. - Bug fixes for converting
imageattachments tophoto.
- Add new
Source.original_post_discovery: add newmax_redirect_fetcheskeyword arg.
v4.0:
Breaking changes
- Drop Python 3.5 support. Python 3.6 is now the minimum required version.
Non-breaking changes
- Add new
include_shareskwarg toget_activities, implemented for Twitter and Mastodon. Defaults toTrue. IfFalse, shares (retweets in Twitter, boosts in Mastodon) will be discarded and not returned. Also add a correspondingsharesquery param to the REST API. - RSS:
- Add support for RSS input via new
rss.to_activitiesfunction.
- Add support for RSS input via new
- Instagram (scraping):
- Handle media items with no
userobject, add new fetch for comments. - Add
Instagram.merge_scraped_comments().
- Handle media items with no
- ActivityStreams 2:
- Handle error when
typeisn't a string.
- Handle error when
- Reddit:
- Implement
get_activities()to fetch posts by the current user or a user specified withuser_id.
- Implement
- Facebook scraping:
- Skip "Suggested for you" posts.
- Add
log_htmlkwarg toget_activities; defaults to False. - Miscellaneous bug fixes.
- JSONFeed:
- Handle malformed
items.authorelement.
- Handle malformed
v3.2:
Notable changes
Source.original_post_discovery: add newinclude_reserved_hostskwarg, defaults toTrue.- Facebook:
- Scraping: handle pictures, videos, link attachments, and text links in timeline/news feed posts.
- Mastodon:
- Bug fix for
get_activities()withfetch_mentions=True: handle notifications withstatus: null. Maybe happens when a status is deleted? create/preview_create: support bookmarks. (Nothing special happens with them; theircontentis posted as a normal toot.)
- Bug fix for
- microformats2:
- Stop rendering
image.displayNameas visible text in HTML, since it's already in the<img>'saltattribute. - Add
bookmark-ofsupport. - Add
prefix_image_urls()function. - Handle null
contentin AS1/2 objects. json_to_objectbug fix for compositebookmark-ofproperties.
- Stop rendering
- Twitter:
create/preview: support large videos via async upload. We now passmedia_category=tweet_videoto the chunked uploadINITstage, and then make blockingSTATUScalls until the video is finished processing. (bridgy#1043)create/preview: allow bookmarks. (bridgy#1045)create/preview: allow non-Twitter replies, ie activities that includeinReplyToURLs even if none of them point to a tweet. (bridgy#1063)get_activities: support list ids as well as slugs.- Bug fixes for removing t.co links to quoted tweets.
- Bug fix for multiple instances of the same link in tweet text.
get_activities(): raiseValueErroron invaliduser_id.
- REST API: ported web framework from webapp2 to Flask. No user-visible behavior change expected.