~
(?:(smile\.|www\.))? # optionally starts with smile. or www.
ama?zo?n\. # also allow shortened amzn.com URLs
(?:
com # match all Amazon domains
|
ca
|
co\.uk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* bluesky-embed.js | |
* | |
* @author Charles Johnson | |
* @url https://github.com/GreenFootballs | |
* | |
* Adds an object named "_bluesky" to the window element, with an "embed" method. | |
* | |
* Runs automatically at window.onload, searches the page for blockquotes with a | |
* "data-bluesky-uri" attribute, converts them to iframes, and resizes them to fit the content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Revised by Charles Johnson - https://github.com/GreenFootballs | |
* | |
* Runs automatically at window.onload(), searches document for iframes with a class of "mastodon-embed" | |
* and resizes them to fit the content, using window.postMessage() to get the content height from the | |
* embedded page. | |
* | |
* Adds an object named "_mastodonTools" to the window element, with an "embed" method. | |
* | |
* To resize dynamically added Mastodon iframes, call "_mastodonTools.embed(container, callback)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mastodonUsers($text) { | |
return preg_replace_callback( | |
'~ | |
(?<= | |
^ | |
| | |
(?<= | |
[^a-zA-Z0-9-.&;/] | |
) |
on addslashes(s)
return (do shell script "sed 's/[\"\\\\'\\'']/\\\\&/g' <<<" & quoted form of s)
end addslashes