Created
October 14, 2024 11:30
-
-
Save dmje/52ce31624a400669ba9a41408819c8a0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
## Mastodon | |
https://tootpick.org/#text=[text] | |
https://twitter.com/intent/tweet?via=[sitename]&text=[text] | |
https://www.facebook.com/sharer.php?u=[url]&t=[text] | |
https://www.linkedin.com/sharing/share-offsite/?url=[url] | |
https://www.reddit.com/submit?url=[url]&title=[text] | |
## HackerNews | |
https://news.ycombinator.com/submitlink?u=[url]&t=[text] | |
https://getpocket.com/save/?url=[url]&title=[text] | |
https://api.whatsapp.com/send/?text=[text] | |
## Telegram | |
https://telegram.me/share/url?url=[url] | |
in code: | |
<?php | |
// Define variables for URL and Text | |
$url = 'https://example.com'; | |
$text = 'Check out this awesome link!'; | |
// Define an array of links | |
$links = [ | |
"Mastodon" => "https://tootpick.org/#text=" . urlencode($text), | |
"Twitter" => "https://twitter.com/intent/tweet?via=sitename&text=" . urlencode($text), | |
"Facebook" => "https://www.facebook.com/sharer.php?u=" . urlencode($url) . "&t=" . urlencode($text), | |
"LinkedIn" => "https://www.linkedin.com/sharing/share-offsite/?url=" . urlencode($url), | |
"Reddit" => "https://www.reddit.com/submit?url=" . urlencode($url) . "&title=" . urlencode($text), | |
"HackerNews" => "https://news.ycombinator.com/submitlink?u=" . urlencode($url) . "&t=" . urlencode($text), | |
"Pocket" => "https://getpocket.com/save/?url=" . urlencode($url) . "&title=" . urlencode($text), | |
"WhatsApp" => "https://api.whatsapp.com/send/?text=" . urlencode($text), | |
"Telegram" => "https://telegram.me/share/url?url=" . urlencode($url) | |
]; | |
?> | |
<!-- Display the bulleted list of links --> | |
<ul> | |
<?php foreach ($links as $site => $link) : ?> | |
<li><a href="<?php echo $link; ?>"><?php echo $site; ?></a></li> | |
<?php endforeach; ?> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment