fork download
  1. <?php
  2.  
  3. // From: Social Share Media
  4. // BSD 3 Clause License
  5. // Check us out : https://g...content-available-to-author-only...b.com/bradvin/social-share-urls
  6.  
  7. class SocialMedia
  8. {
  9. # All Social Media Sites
  10. # -------------------------------------------------
  11.  
  12. # All Social Media Sites ~ Nice Names
  13. # -------------------------------------------------
  14.  
  15. public function GetSocialMediaSites_NiceNames()
  16. {
  17. return [
  18. 'add.this'=>'AddThis',
  19. 'blogger'=>'Blogger',
  20. 'buffer'=>'Buffer',
  21. 'diaspora'=>'Diaspora',
  22. 'digg'=>'Digg',
  23. 'douban'=>'Douban',
  24. 'email'=>'EMail',
  25. 'evernote'=>'EverNote',
  26. 'getpocket'=>'Pocket',
  27. 'facebook'=>'FaceBook',
  28. 'flattr'=>'Flattr',
  29. 'flipboard'=>'FlipBoard',
  30. 'google.bookmarks'=>'GoogleBookmarks',
  31. 'instapaper'=>'InstaPaper',
  32. 'line.me'=>'Line.me',
  33. 'linkedin'=>'LinkedIn',
  34. 'livejournal'=>'LiveJournal',
  35. 'gmail'=>'GMail',
  36. 'hacker.news'=>'HackerNews',
  37. 'ok.ru'=>'OK.ru',
  38. 'pinterest.com'=>'Pinterest',
  39. 'google.plus'=>'GooglePlus',
  40. 'qzone'=>'QZone',
  41. 'reddit'=>'Reddit',
  42. 'renren'=>'RenRen',
  43. 'skype'=>'Skype',
  44. 'sms'=>'SMS',
  45. 'stumbleupon'=>'StumbleUpon',
  46. 'surfingbird.ru'=>'SurfingBird.ru',
  47. 'telegram.me'=>'Telegram.me',
  48. 'threema'=>'Threema',
  49. 'tumblr'=>'Tumblr',
  50. 'twitter'=>'Twitter',
  51. 'vk'=>'VK',
  52. 'weibo'=>'Weibo',
  53. 'xing'=>'Xing',
  54. 'yahoo'=>'Yahoo',
  55. ];
  56. }
  57.  
  58. # Social Media Sites With Share Links
  59. # -------------------------------------------------
  60.  
  61. public function GetSocialMediaSites_WithShareLinks_OrderedByPopularity()
  62. {
  63. return [
  64. 'google.plus',
  65. 'google.bookmarks',
  66. 'facebook',
  67. 'reddit',
  68. 'twitter',
  69. 'linkedin',
  70. 'tumblr',
  71. 'pinterest',
  72. 'blogger',
  73. 'livejournal',
  74. 'evernote',
  75. 'add.this',
  76. 'getpocket',
  77. 'hacker.news',
  78. 'stumbleupon',
  79. 'digg',
  80. 'buffer',
  81. 'flipboard',
  82. 'instapaper',
  83. 'surfingbird.ru',
  84. 'flattr',
  85. 'diaspora',
  86. 'qzone',
  87. 'vk',
  88. 'weibo',
  89. 'ok.ru',
  90. 'douban',
  91. 'xing',
  92. 'renren',
  93. 'threema',
  94. 'sms',
  95. 'line.me',
  96. 'skype',
  97. 'telegram.me',
  98. 'email',
  99. 'gmail',
  100. 'yahoo',
  101. ];
  102. }
  103.  
  104. public function GetSocialMediaSites_WithShareLinks_OrderedByAlphabet()
  105. {
  106. $nice_names = $this->GetSocialMediaSites_NiceNames();
  107.  
  108. return array_keys($nice_names);
  109. }
  110.  
  111. # Social Media Site Links With Share Links
  112. # -------------------------------------------------
  113.  
  114. public function GetSocialMediaSiteLinks_WithShareLinks($args)
  115. {
  116. $url = urlencode($args['url']);
  117. $title = urlencode($args['title']);
  118. $image = urlencode($args['image']);
  119. $desc = urlencode($args['desc']);
  120. $app_id = urlencode($args['appid']);
  121. $redirect_url = urlencode($args['redirecturl']);
  122. $via = urlencode($args['via']);
  123. $hash_tags = urlencode($args['hashtags']);
  124. $provider = urlencode($args['provider']);
  125. $language = urlencode($args['language']);
  126. $user_id = urlencode($args['userid']);
  127. $category = urlencode($args['category']);
  128. $phone_number = urlencode($args['phonenumber']);
  129. $email_address = urlencode($args['emailaddress']);
  130. $cc_email_address = urlencode($args['ccemailaddress']);
  131. $bcc_email_address = urlencode($args['bccemailaddress']);
  132.  
  133. $text = $title;
  134.  
  135. if($desc) {
  136. $text .= '%20%3A%20'; # This is just this, " : "
  137. $text .= $desc;
  138. }
  139.  
  140. // conditional check before arg appending
  141.  
  142. return [
  143. 'add.this'=>'http://w...content-available-to-author-only...s.com/bookmark.php?url=' . $url,
  144. 'blogger'=>'https://w...content-available-to-author-only...r.com/blog-this.g?u=' . $url . '&n=' . $title . '&t=' . $desc,
  145. 'buffer'=>'https://b...content-available-to-author-only...r.com/add?text=' . $text . '&url=' . $url,
  146. 'diaspora'=>'https://s...content-available-to-author-only...n.org/?title=' . $title . '&url=' . $url,
  147. 'digg'=>'http://d...content-available-to-author-only...g.com/submit?url=' . $url . '&title=' . $text,
  148. 'douban'=>'http://w...content-available-to-author-only...n.com/recommend/?url=' . $url . '&title=' . $text,
  149. 'email'=>'mailto:' . $email_address . '?subject=' . $title . '&body=' . $desc,
  150. 'evernote'=>'http://w...content-available-to-author-only...e.com/clip.action?url=' . $url . '&title=' . $text,
  151. 'getpocket'=>'https://g...content-available-to-author-only...t.com/edit?url=' . $url,
  152. 'facebook'=>'http://w...content-available-to-author-only...k.com/sharer.php?u=' . $url,
  153. 'flattr'=>'https://f...content-available-to-author-only...r.com/submit/auto?user_id=' . $user_id . '&url=' . $url . '&title=' . $title . '&description=' . $text . '&language=' . $language . '&tags=' . $hash_tags . '&hidden=HIDDEN&category=' . $category,
  154. 'flipboard'=>'https://s...content-available-to-author-only...d.com/bookmarklet/popout?v=2&title=' . $text . '&url=' . $url,
  155. 'gmail'=>'https://mail.google.com/mail/?view=cm&to=' . $email_address . '&su=' . $title . '&body=' . $url . '&bcc=' . $bcc_email_address . '&cc=' . $cc_email_address,
  156. 'google.bookmarks'=>'https://www.google.com/bookmarks/mark?op=edit&bkmk=' . $url . '&title=' . $title . '&annotation=' . $text . '&labels=' . $hash_tags . '',
  157. 'instapaper'=>'http://w...content-available-to-author-only...r.com/edit?url=' . $url . '&title=' . $title . '&description=' . $desc,
  158. 'line.me'=>'https://l...content-available-to-author-only...e.me/share/ui?url=' . $url . '&text=' . $text,
  159. 'linkedin'=>'https://w...content-available-to-author-only...n.com/shareArticle?mini=true&url=' . $url . '&title=' . $title . '&summary=' . $text . '&source=' . $provider,
  160. 'livejournal'=>'http://w...content-available-to-author-only...l.com/update.bml?subject=' . $text . '&event=' . $url,
  161. 'hacker.news'=>'https://n...content-available-to-author-only...r.com/submitlink?u=' . $url . '&t=' . $title,
  162. 'ok.ru'=>'https://c...content-available-to-author-only...k.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=' . $url,
  163. 'pinterest'=>'http://p...content-available-to-author-only...t.com/pin/create/button/?url=' . $url ,
  164. 'google.plus'=>'https://plus.google.com/share?url=' . $url . '&text=' . $text . '&hl=' . $language,
  165. 'qzone'=>'http://s...content-available-to-author-only...q.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' . $url,
  166. 'reddit'=>'https://r...content-available-to-author-only...t.com/submit?url=' . $url . '&title=' . $title,
  167. 'renren'=>'http://w...content-available-to-author-only...n.com/dialog/share?resourceUrl=' . $url . '&srcUrl=' . $url . '&title=' . $text . '&description=' . $desc,
  168. 'skype'=>'https://w...content-available-to-author-only...e.com/share?url=' . $url . '&text=' . $text,
  169. 'sms'=>'sms:' . $phone_number . '?body=' . $text,
  170. 'stumbleupon'=>'http://w...content-available-to-author-only...n.com/submit?url=' . $url . '&title=' . $text,
  171. 'surfingbird.ru'=>'http://s...content-available-to-author-only...d.ru/share?url=' . $url . '&description=' . $desc . '&screenshot=' . $image . '&title=' . $title,
  172. 'telegram.me'=>'https://content-available-to-author-only.me/share/url?url=' . $url . '&text=' . $text . '&to=' . $phone_number,
  173. 'threema'=>'threema://compose?text=' . $text . '&id=' . $user_id,
  174. 'tumblr'=>'https://w...content-available-to-author-only...r.com/widgets/share/tool?canonicalUrl=' . $url . '&title=' . $title . '&caption=' . $desc . '&tags=' . $hash_tags,
  175. 'twitter'=>'https://t...content-available-to-author-only...r.com/intent/tweet?url=' . $url . '&text=' . $text . '&via=' . $via . '&hashtags=' . $hash_tags,
  176. 'vk'=>'http://content-available-to-author-only.com/share.php?url=' . $url . '&title=' . $title . '&comment=' . $desc,
  177. 'weibo'=>'http://s...content-available-to-author-only...o.com/share/share.php?url=' . $url . '&appkey=&title=' . $title . '&pic=&ralateUid=',
  178. 'xing'=>'https://w...content-available-to-author-only...g.com/app/user?op=share&url=' . $url,
  179. 'yahoo'=>'http://c...content-available-to-author-only...o.com/?to=' . $email_address . '&subject=' . $title . '&body=' . $text,
  180. ];
  181. }
  182. }
  183.  
  184. $socmed = new SocialMedia();
  185.  
  186. $social_media_names = $socmed->GetSocialMediaSites_WithShareLinks_OrderedByPopularity();
  187. $social_media_urls = $socmed->GetSocialMediaSiteLinks_WithShareLinks([
  188. url=>'http://w...content-available-to-author-only...t.com/',
  189. title=>'EarthFluent',
  190. ]);
  191.  
  192. foreach($social_media_names as $social_media_name) {
  193. $social_media_url = $social_media_urls[$social_media_name];
  194.  
  195. print($social_media_name . ' : ' . $social_media_url . "\n\n");
  196. }
  197.  
  198. ?>
Success #stdin #stdout #stderr 0.02s 23900KB
stdin
Standard input is empty
stdout
google.plus : https://plus.google.com/share?url=http%3A%2F%2Fwww.earthfluent.com%2F&text=EarthFluent&hl=

google.bookmarks : https://www.google.com/bookmarks/mark?op=edit&bkmk=http%3A%2F%2Fwww.earthfluent.com%2F&title=EarthFluent&annotation=EarthFluent&labels=

facebook : http://w...content-available-to-author-only...k.com/sharer.php?u=http%3A%2F%2Fwww.earthfluent.com%2F

reddit : https://r...content-available-to-author-only...t.com/submit?url=http%3A%2F%2Fwww.earthfluent.com%2F&title=EarthFluent

twitter : https://t...content-available-to-author-only...r.com/intent/tweet?url=http%3A%2F%2Fwww.earthfluent.com%2F&text=EarthFluent&via=&hashtags=

linkedin : https://w...content-available-to-author-only...n.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.earthfluent.com%2F&title=EarthFluent&summary=EarthFluent&source=

tumblr : https://w...content-available-to-author-only...r.com/widgets/share/tool?canonicalUrl=http%3A%2F%2Fwww.earthfluent.com%2F&title=EarthFluent&caption=&tags=

pinterest : http://p...content-available-to-author-only...t.com/pin/create/button/?url=http%3A%2F%2Fwww.earthfluent.com%2F

blogger : https://w...content-available-to-author-only...r.com/blog-this.g?u=http%3A%2F%2Fwww.earthfluent.com%2F&n=EarthFluent&t=

livejournal : http://w...content-available-to-author-only...l.com/update.bml?subject=EarthFluent&event=http%3A%2F%2Fwww.earthfluent.com%2F

evernote : http://w...content-available-to-author-only...e.com/clip.action?url=http%3A%2F%2Fwww.earthfluent.com%2F&title=EarthFluent

add.this : http://w...content-available-to-author-only...s.com/bookmark.php?url=http%3A%2F%2Fwww.earthfluent.com%2F

getpocket : https://g...content-available-to-author-only...t.com/edit?url=http%3A%2F%2Fwww.earthfluent.com%2F

hacker.news : https://n...content-available-to-author-only...r.com/submitlink?u=http%3A%2F%2Fwww.earthfluent.com%2F&t=EarthFluent

stumbleupon : http://w...content-available-to-author-only...n.com/submit?url=http%3A%2F%2Fwww.earthfluent.com%2F&title=EarthFluent

digg : http://d...content-available-to-author-only...g.com/submit?url=http%3A%2F%2Fwww.earthfluent.com%2F&title=EarthFluent

buffer : https://b...content-available-to-author-only...r.com/add?text=EarthFluent&url=http%3A%2F%2Fwww.earthfluent.com%2F

flipboard : https://s...content-available-to-author-only...d.com/bookmarklet/popout?v=2&title=EarthFluent&url=http%3A%2F%2Fwww.earthfluent.com%2F

instapaper : http://w...content-available-to-author-only...r.com/edit?url=http%3A%2F%2Fwww.earthfluent.com%2F&title=EarthFluent&description=

surfingbird.ru : http://s...content-available-to-author-only...d.ru/share?url=http%3A%2F%2Fwww.earthfluent.com%2F&description=&screenshot=&title=EarthFluent

flattr : https://f...content-available-to-author-only...r.com/submit/auto?user_id=&url=http%3A%2F%2Fwww.earthfluent.com%2F&title=EarthFluent&description=EarthFluent&language=&tags=&hidden=HIDDEN&category=

diaspora : https://s...content-available-to-author-only...n.org/?title=EarthFluent&url=http%3A%2F%2Fwww.earthfluent.com%2F

qzone : http://s...content-available-to-author-only...q.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=http%3A%2F%2Fwww.earthfluent.com%2F

vk : http://content-available-to-author-only.com/share.php?url=http%3A%2F%2Fwww.earthfluent.com%2F&title=EarthFluent&comment=

weibo : http://s...content-available-to-author-only...o.com/share/share.php?url=http%3A%2F%2Fwww.earthfluent.com%2F&appkey=&title=EarthFluent&pic=&ralateUid=

ok.ru : https://c...content-available-to-author-only...k.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=http%3A%2F%2Fwww.earthfluent.com%2F

douban : http://w...content-available-to-author-only...n.com/recommend/?url=http%3A%2F%2Fwww.earthfluent.com%2F&title=EarthFluent

xing : https://w...content-available-to-author-only...g.com/app/user?op=share&url=http%3A%2F%2Fwww.earthfluent.com%2F

renren : http://w...content-available-to-author-only...n.com/dialog/share?resourceUrl=http%3A%2F%2Fwww.earthfluent.com%2F&srcUrl=http%3A%2F%2Fwww.earthfluent.com%2F&title=EarthFluent&description=

threema : threema://compose?text=EarthFluent&id=

sms : sms:?body=EarthFluent

line.me : https://l...content-available-to-author-only...e.me/share/ui?url=http%3A%2F%2Fwww.earthfluent.com%2F&text=EarthFluent

skype : https://w...content-available-to-author-only...e.com/share?url=http%3A%2F%2Fwww.earthfluent.com%2F&text=EarthFluent

telegram.me : https://content-available-to-author-only.me/share/url?url=http%3A%2F%2Fwww.earthfluent.com%2F&text=EarthFluent&to=

email : mailto:?subject=EarthFluent&body=

gmail : https://mail.google.com/mail/?view=cm&to=&su=EarthFluent&body=http%3A%2F%2Fwww.earthfluent.com%2F&bcc=&cc=

yahoo : http://c...content-available-to-author-only...o.com/?to=&subject=EarthFluent&body=EarthFluent

stderr
PHP Notice:  Use of undefined constant url - assumed 'url' in /home/uY7nTR/prog.php on line 188
PHP Notice:  Use of undefined constant title - assumed 'title' in /home/uY7nTR/prog.php on line 189
PHP Notice:  Undefined index: image in /home/uY7nTR/prog.php on line 118
PHP Notice:  Undefined index: desc in /home/uY7nTR/prog.php on line 119
PHP Notice:  Undefined index: appid in /home/uY7nTR/prog.php on line 120
PHP Notice:  Undefined index: redirecturl in /home/uY7nTR/prog.php on line 121
PHP Notice:  Undefined index: via in /home/uY7nTR/prog.php on line 122
PHP Notice:  Undefined index: hashtags in /home/uY7nTR/prog.php on line 123
PHP Notice:  Undefined index: provider in /home/uY7nTR/prog.php on line 124
PHP Notice:  Undefined index: language in /home/uY7nTR/prog.php on line 125
PHP Notice:  Undefined index: userid in /home/uY7nTR/prog.php on line 126
PHP Notice:  Undefined index: category in /home/uY7nTR/prog.php on line 127
PHP Notice:  Undefined index: phonenumber in /home/uY7nTR/prog.php on line 128
PHP Notice:  Undefined index: emailaddress in /home/uY7nTR/prog.php on line 129
PHP Notice:  Undefined index: ccemailaddress in /home/uY7nTR/prog.php on line 130
PHP Notice:  Undefined index: bccemailaddress in /home/uY7nTR/prog.php on line 131