fork download
  1. class SocialMedia:
  2. def __init__(self):
  3. pass
  4.  
  5. def GetSocialMediaSites_NiceNames(self):
  6. return {
  7. 'add.this':'AddThis',
  8. 'blogger':'Blogger',
  9. 'buffer':'Buffer',
  10. 'diaspora':'Diaspora',
  11. 'digg':'Digg',
  12. 'douban':'Douban',
  13. 'email':'EMail',
  14. 'evernote':'EverNote',
  15. 'getpocket':'Pocket',
  16. 'facebook':'FaceBook',
  17. 'flattr':'Flattr',
  18. 'flipboard':'FlipBoard',
  19. 'google.bookmarks':'GoogleBookmarks',
  20. 'instapaper':'InstaPaper',
  21. 'line.me':'Line.me',
  22. 'linkedin':'LinkedIn',
  23. 'livejournal':'LiveJournal',
  24. 'gmail':'GMail',
  25. 'hacker.news':'HackerNews',
  26. 'ok.ru':'OK.ru',
  27. 'pinterest.com':'Pinterest',
  28. 'google.plus':'GooglePlus',
  29. 'qzone':'QZone',
  30. 'reddit':'Reddit',
  31. 'renren':'RenRen',
  32. 'skype':'Skype',
  33. 'sms':'SMS',
  34. 'stumbleupon':'StumbleUpon',
  35. 'surfingbird.ru':'SurfingBird.ru',
  36. 'telegram.me':'Telegram.me',
  37. 'threema':'Threema',
  38. 'tumblr':'Tumblr',
  39. 'twitter':'Twitter',
  40. 'vk':'VK',
  41. 'weibo':'Weibo',
  42. 'xing':'Xing',
  43. 'yahoo':'Yahoo',
  44. }
  45.  
  46. def GetSocialMediaSites_WithShareLinks_OrderedByPopularity(self):
  47. return [
  48. 'google.plus',
  49. 'google.bookmarks',
  50. 'facebook',
  51. 'reddit',
  52. 'twitter',
  53. 'linkedin',
  54. 'tumblr',
  55. 'pinterest',
  56. 'blogger',
  57. 'livejournal',
  58. 'evernote',
  59. 'add.this',
  60. 'getpocket',
  61. 'hacker.news',
  62. 'stumbleupon',
  63. 'digg',
  64. 'buffer',
  65. 'flipboard',
  66. 'instapaper',
  67. 'surfingbird.ru',
  68. 'flattr',
  69. 'diaspora',
  70. 'qzone',
  71. 'vk',
  72. 'weibo',
  73. 'ok.ru',
  74. 'douban',
  75. 'xing',
  76. 'renren',
  77. 'threema',
  78. 'sms',
  79. 'line.me',
  80. 'skype',
  81. 'telegram.me',
  82. 'email',
  83. 'gmail',
  84. 'yahoo',
  85. ]
  86.  
  87. def GetSocialMediaSites_WithShareLinks_OrderedByAlphabet(self):
  88. socialmediasites = self.GetSocialMediaSites_NiceNames().keys()
  89. socialmediasites.sort()
  90. return socialmediasites
  91.  
  92. def GetSocialMediaSiteLinks_WithShareLinks(self, args):
  93. safeargs = [
  94. 'url',
  95. 'title',
  96. 'image',
  97. 'desc',
  98. 'appid',
  99. 'redirecturl',
  100. 'via',
  101. 'hash_tags',
  102. 'provider',
  103. 'language',
  104. 'user_id',
  105. 'category',
  106. 'phone_number',
  107. 'email_address',
  108. 'cc_email_address',
  109. 'bcc_email_address',
  110. ]
  111.  
  112. for safearg in safeargs:
  113. if not args.get(safearg):
  114. args[safearg] = ''
  115.  
  116. text = args['title']
  117.  
  118. if len(args['desc']):
  119. text += '%20%3A%20' + args['desc']
  120.  
  121. return {
  122. 'add.this':'http://w...content-available-to-author-only...s.com/bookmark.php?url=' + args['url'],
  123. 'blogger':'https://w...content-available-to-author-only...r.com/blog-this.g?u=' + args['url'] + '&n=' + args['title'] + '&t=' + args['desc'],
  124. 'buffer':'https://b...content-available-to-author-only...r.com/add?text=' + text + '&url=' + args['url'],
  125. 'diaspora':'https://s...content-available-to-author-only...n.org/?title=' + args['title'] + '&url=' + args['url'],
  126. 'digg':'http://d...content-available-to-author-only...g.com/submit?url=' + args['url'] + '&title=' + text,
  127. 'douban':'http://w...content-available-to-author-only...n.com/recommend/?url=' + args['url'] + '&title=' + text,
  128. 'email':'mailto:' + args['email_address'] + '?subject=' + args['title'] + '&body=' + args['desc'],
  129. 'evernote':'http://w...content-available-to-author-only...e.com/clip.action?url=' + args['url'] + '&title=' + text,
  130. 'getpocket':'https://g...content-available-to-author-only...t.com/edit?url=' + args['url'],
  131. 'facebook':'http://w...content-available-to-author-only...k.com/sharer.php?u=' + args['url'],
  132. 'flattr':'https://f...content-available-to-author-only...r.com/submit/auto?user_id=' + args['user_id'] + '&url=' + args['url'] + '&title=' + args['title'] + '&description=' + text + '&language=' + args['language'] + '&tags=' + args['hash_tags'] + '&hidden=HIDDEN&category=' + args['category'],
  133. 'flipboard':'https://s...content-available-to-author-only...d.com/bookmarklet/popout?v=2&title=' + text + '&url=' + args['url'],
  134. 'gmail':'https://mail.google.com/mail/?view=cm&to=' + args['email_address'] + '&su=' + args['title'] + '&body=' + args['url'] + '&bcc=' + args['bcc_email_address'] + '&cc=' + args['cc_email_address'],
  135. 'google.bookmarks':'https://www.google.com/bookmarks/mark?op=edit&bkmk=' + args['url'] + '&title=' + args['title'] + '&annotation=' + text + '&labels=' + args['hash_tags'] + '',
  136. 'instapaper':'http://w...content-available-to-author-only...r.com/edit?url=' + args['url'] + '&title=' + args['title'] + '&description=' + args['desc'],
  137. 'line.me':'https://l...content-available-to-author-only...e.me/share/ui?url=' + args['url'] + '&text=' + text,
  138. 'linkedin':'https://w...content-available-to-author-only...n.com/shareArticle?mini=true&url=' + args['url'] + '&title=' + args['title'] + '&summary=' + text + '&source=' + args['provider'],
  139. 'livejournal':'http://w...content-available-to-author-only...l.com/update.bml?subject=' + text + '&event=' + args['url'],
  140. 'hacker.news':'https://n...content-available-to-author-only...r.com/submitlink?u=' + args['url'] + '&t=' + args['title'],
  141. 'ok.ru':'https://c...content-available-to-author-only...k.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=' + args['url'],
  142. 'pinterest':'http://p...content-available-to-author-only...t.com/pin/create/button/?url=' + args['url'] ,
  143. 'google.plus':'https://plus.google.com/share?url=' + args['url'] + '&text=' + text,
  144. 'qzone':'http://s...content-available-to-author-only...q.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + args['url'],
  145. 'reddit':'https://r...content-available-to-author-only...t.com/submit?url=' + args['url'] + '&title=' + args['title'],
  146. 'renren':'http://w...content-available-to-author-only...n.com/dialog/share?resourceUrl=' + args['url'] + '&srcUrl=' + args['url'] + '&title=' + text + '&description=' + args['desc'],
  147. 'skype':'https://w...content-available-to-author-only...e.com/share?url=' + args['url'] + '&text=' + text,
  148. 'sms':'sms:' + args['phone_number'] + '?body=' + text,
  149. 'stumbleupon':'http://w...content-available-to-author-only...n.com/submit?url=' + args['url'] + '&title=' + text,
  150. 'surfingbird.ru':'http://s...content-available-to-author-only...d.ru/share?url=' + args['url'] + '&description=' + args['desc'] + '&screenshot=' + args['image'] + '&title=' + args['title'],
  151. 'telegram.me':'https://content-available-to-author-only.me/share/url?url=' + args['url'] + '&text=' + text + '&to=' + args['phone_number'],
  152. 'threema':'threema://compose?text=' + text + '&id=' + args['user_id'],
  153. 'tumblr':'https://w...content-available-to-author-only...r.com/widgets/share/tool?canonicalUrl=' + args['url'] + '&title=' + args['title'] + '&caption=' + args['desc'] + '&tags=' + args['hash_tags'],
  154. 'twitter':'https://t...content-available-to-author-only...r.com/intent/tweet?url=' + args['url'] + '&text=' + text + '&via=' + args['via'] + '&hashtags=' + args['hash_tags'],
  155. 'vk':'http://content-available-to-author-only.com/share.php?url=' + args['url'] + '&title=' + args['title'] + '&comment=' + args['desc'],
  156. 'weibo':'http://s...content-available-to-author-only...o.com/share/share.php?url=' + args['url'] + '&appkey=&title=' + args['title'] + '&pic=&ralateUid=',
  157. 'xing':'https://w...content-available-to-author-only...g.com/app/user?op=share&url=' + args['url'],
  158. 'yahoo':'http://c...content-available-to-author-only...o.com/?to=' + args['email_address'] + '&subject=' + args['title'] + '&body=' + text,
  159. }
  160.  
  161. sm = SocialMedia()
  162. #socialmediasites = sm.GetSocialMediaSites_WithShareLinks_OrderedByAlphabet()
  163. socialmediasites = sm.GetSocialMediaSites_WithShareLinks_OrderedByPopularity()
  164. socialmediaurls = sm.GetSocialMediaSiteLinks_WithShareLinks({
  165. 'url':'http://w...content-available-to-author-only...t.com/',
  166. 'title':'EarthFluent',
  167. })
  168. #print(socialmediaurls['add.this'])
  169. #print(socialmediaurls.keys())
  170.  
  171. for socialmediasite in socialmediasites:
  172. print(socialmediasite + " : " + socialmediaurls[socialmediasite])
  173. pass
Success #stdin #stdout 0.02s 6804KB
stdin
Standard input is empty
stdout
google.plus : https://plus.google.com/share?url=http://w...content-available-to-author-only...t.com/&text=EarthFluent
google.bookmarks : https://www.google.com/bookmarks/mark?op=edit&bkmk=http://w...content-available-to-author-only...t.com/&title=EarthFluent&annotation=EarthFluent&labels=
facebook : http://w...content-available-to-author-only...k.com/sharer.php?u=http://w...content-available-to-author-only...t.com/
reddit : https://r...content-available-to-author-only...t.com/submit?url=http://w...content-available-to-author-only...t.com/&title=EarthFluent
twitter : https://t...content-available-to-author-only...r.com/intent/tweet?url=http://w...content-available-to-author-only...t.com/&text=EarthFluent&via=&hashtags=
linkedin : https://w...content-available-to-author-only...n.com/shareArticle?mini=true&url=http://w...content-available-to-author-only...t.com/&title=EarthFluent&summary=EarthFluent&source=
tumblr : https://w...content-available-to-author-only...r.com/widgets/share/tool?canonicalUrl=http://w...content-available-to-author-only...t.com/&title=EarthFluent&caption=&tags=
pinterest : http://p...content-available-to-author-only...t.com/pin/create/button/?url=http://w...content-available-to-author-only...t.com/
blogger : https://w...content-available-to-author-only...r.com/blog-this.g?u=http://w...content-available-to-author-only...t.com/&n=EarthFluent&t=
livejournal : http://w...content-available-to-author-only...l.com/update.bml?subject=EarthFluent&event=http://w...content-available-to-author-only...t.com/
evernote : http://w...content-available-to-author-only...e.com/clip.action?url=http://w...content-available-to-author-only...t.com/&title=EarthFluent
add.this : http://w...content-available-to-author-only...s.com/bookmark.php?url=http://w...content-available-to-author-only...t.com/
getpocket : https://g...content-available-to-author-only...t.com/edit?url=http://w...content-available-to-author-only...t.com/
hacker.news : https://n...content-available-to-author-only...r.com/submitlink?u=http://w...content-available-to-author-only...t.com/&t=EarthFluent
stumbleupon : http://w...content-available-to-author-only...n.com/submit?url=http://w...content-available-to-author-only...t.com/&title=EarthFluent
digg : http://d...content-available-to-author-only...g.com/submit?url=http://w...content-available-to-author-only...t.com/&title=EarthFluent
buffer : https://b...content-available-to-author-only...r.com/add?text=EarthFluent&url=http://w...content-available-to-author-only...t.com/
flipboard : https://s...content-available-to-author-only...d.com/bookmarklet/popout?v=2&title=EarthFluent&url=http://w...content-available-to-author-only...t.com/
instapaper : http://w...content-available-to-author-only...r.com/edit?url=http://w...content-available-to-author-only...t.com/&title=EarthFluent&description=
surfingbird.ru : http://s...content-available-to-author-only...d.ru/share?url=http://w...content-available-to-author-only...t.com/&description=&screenshot=&title=EarthFluent
flattr : https://f...content-available-to-author-only...r.com/submit/auto?user_id=&url=http://w...content-available-to-author-only...t.com/&title=EarthFluent&description=EarthFluent&language=&tags=&hidden=HIDDEN&category=
diaspora : https://s...content-available-to-author-only...n.org/?title=EarthFluent&url=http://w...content-available-to-author-only...t.com/
qzone : http://s...content-available-to-author-only...q.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=http://w...content-available-to-author-only...t.com/
vk : http://content-available-to-author-only.com/share.php?url=http://w...content-available-to-author-only...t.com/&title=EarthFluent&comment=
weibo : http://s...content-available-to-author-only...o.com/share/share.php?url=http://w...content-available-to-author-only...t.com/&appkey=&title=EarthFluent&pic=&ralateUid=
ok.ru : https://c...content-available-to-author-only...k.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=http://w...content-available-to-author-only...t.com/
douban : http://w...content-available-to-author-only...n.com/recommend/?url=http://w...content-available-to-author-only...t.com/&title=EarthFluent
xing : https://w...content-available-to-author-only...g.com/app/user?op=share&url=http://w...content-available-to-author-only...t.com/
renren : http://w...content-available-to-author-only...n.com/dialog/share?resourceUrl=http://w...content-available-to-author-only...t.com/&srcUrl=http://w...content-available-to-author-only...t.com/&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://w...content-available-to-author-only...t.com/&text=EarthFluent
skype : https://w...content-available-to-author-only...e.com/share?url=http://w...content-available-to-author-only...t.com/&text=EarthFluent
telegram.me : https://content-available-to-author-only.me/share/url?url=http://w...content-available-to-author-only...t.com/&text=EarthFluent&to=
email : mailto:?subject=EarthFluent&body=
gmail : https://mail.google.com/mail/?view=cm&to=&su=EarthFluent&body=http://w...content-available-to-author-only...t.com/&bcc=&cc=
yahoo : http://c...content-available-to-author-only...o.com/?to=&subject=EarthFluent&body=EarthFluent