forked from bradvin/social-share-urls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSocialMedia.cs
220 lines (204 loc) · 6.85 KB
/
SocialMedia.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
using System;
public static class Globals
{
public static readonly int SOCIALMEDIASERVICES = 35;
public static readonly int URLSIZE = 1024;
public static readonly int ARGLENGTH = 1024;
}
public class SocialMedia
{
public string title;
public string url;
public string image;
public string desc;
public string appid;
public string redirecturl;
public string via;
public string hash_tags;
public string provider;
public string language;
public string user_id;
public string category;
public string phone_number;
public string email_address;
public string cc_email_address;
public string bcc_email_address;
public string[] urls = new string[Globals.SOCIALMEDIASERVICES];
public string[] servicesSortedByPopularity = {
"google.bookmarks",
"facebook",
"reddit",
"whatsapp",
"twitter",
"linkedin",
"tumblr",
"pinterest",
"blogger",
"livejournal",
"evernote",
"add.this",
"getpocket",
"hacker.news",
"buffer",
"flipboard",
"instapaper",
"surfingbird.ru",
"flattr",
"diaspora",
"qzone",
"vk",
"weibo",
"ok.ru",
"douban",
"xing",
"renren",
"threema",
"sms",
"line.me",
"skype",
"telegram.me",
"email",
"gmail",
"yahoo",
};
public SocialMedia() { }
public SocialMedia(string argTitle, string argUrl)
{
title = argTitle;
url = argUrl;
buildUrls();
}
public SocialMedia(
string argTitle,
string argUrl,
string argImage,
string argDesc,
string argAppid,
string argRedirecturl,
string argVia,
string argHash_tags,
string argProvider,
string argLanguage,
string argUser_id,
string argCategory,
string argPhone_number,
string argEmail_address,
string argCc_email_address,
string argBcc_email_address
)
{
title = argTitle;
url = argUrl;
image = argImage;
desc = argDesc;
appid = argAppid;
redirecturl = argRedirecturl;
via = argVia;
hash_tags = argHash_tags;
provider = argProvider;
language = argLanguage;
user_id = argUser_id;
category = argCategory;
phone_number = argPhone_number;
email_address = argEmail_address;
cc_email_address = argCc_email_address;
bcc_email_address = argBcc_email_address;
buildUrls();
}
public void buildUrls()
{
//Console.WriteLine("BULIDERISH!!");
//urls[0] = "huhhhhhh?????";
string text = title;
if(desc != "")
{
text += "%20%3A%20";
text += desc;
}
string addthis = "http://www.addthis.com/bookmark.php?url=" + url;
string blogger = "https://www.blogger.com/blog-this.g?u=" + url + "&n=" + title + "&t=" + desc;
string buffer = "https://buffer.com/add?text=" + text + "&url=" + url;
string diaspora = "https://share.diasporafoundation.org/?title=" + title + "&url=" + url;
string douban = "http://www.douban.com/recommend/?url=" + url + "&title=" + title;
string email = "mailto:" + email_address + "?subject=" + title + "&body=" + desc;
string evernote = "https://www.evernote.com/clip.action?url=" + url + "&title=" + text;
string getpocket = "https://getpocket.com/edit?url=" + url;
string facebook = "http://www.facebook.com/sharer.php?u=" + url;
string flattr = "https://flattr.com/submit/auto?user_id=" + user_id + "&url=" + url + "&title=" + title + "&description=" + text + "&language=" + language + "&tags=" + hash_tags + "&hidden=HIDDEN&category=" + category;
string flipboard = "https://share.flipboard.com/bookmarklet/popout?v=2&title=" + text + "&url=" + url;
string gmail = "https://mail.google.com/mail/?view=cm&to=" + email_address + "&su=" + title + "&body=" + url + "&bcc=" + bcc_email_address + "&cc=" + cc_email_address;
string googlebookmarks = "https://www.google.com/bookmarks/mark?op=edit&bkmk=" + url + "&title=" + title + "&annotation=" + text + "&labels=" + hash_tags;
string instapaper = "http://www.instapaper.com/edit?url=" + url + "&title=" + title + "&description=" + desc;
string lineme = "https://lineit.line.me/share/ui?url=" + url + "&text=" + text;
string linkedin = "https://www.linkedin.com/sharing/share-offsite/?url=" + url;
string livejournal = "http://www.livejournal.com/update.bml?subject=" + text + "&event=" + url;
string hackernews = "https://news.ycombinator.com/submitlink?u=" + url + "&t=" + title;
string okru = "https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=" + url;
string pinterest = "http://pinterest.com/pin/create/button/?url=" + url;
string qzone = "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=" + url;
string reddit = "https://reddit.com/submit?url=" + url + "&title=" + title;
string renren = "http://widget.renren.com/dialog/share?resourceUrl=" + url + "&srcUrl=" + url + "&title=" + text + "&description=" + desc;
string skype = "https://web.skype.com/share?url=" + url + "&text=" + text;
string sms = "sms:" + phone_number + "?body=" + text;
string surfingbird = "http://surfingbird.ru/share?url=" + url + "&description=" + desc + "&screenshot=" + image + "&title=" + title;
string telegramme = "https://t.me/share/url?url=" + url + "&text=" + text + "&to=" + phone_number;
string threema = "threema://compose?text=" + text + "&id=" + user_id;
string tumblr = "https://www.tumblr.com/widgets/share/tool?canonicalUrl=" + url + "&title=" + title + "&caption=" + desc + "&tags=" + hash_tags;
string twitter = "https://twitter.com/intent/tweet?url=" + url + "&text=" + text + "&via=" + via + "&hashtags=" + hash_tags;
string vk = "http://vk.com/share.php?url=" + url + "&title=" + title + "&comment=" + desc;
string weibo = "http://service.weibo.com/share/share.php?url=" + url + "&appkey=&title=" + title + "&pic=&ralateUid=";
string whatsapp = "https://api.whatsapp.com/send?text=" + text + '%20' + url;
string xing = "https://www.xing.com/spi/shares/new?url=" + url;
string yahoo = "http://compose.mail.yahoo.com/?to=" + email_address + "&subject=" + title + "&body=" + text;
int i = 0;
urls[i++] = googlebookmarks;
urls[i++] = facebook;
urls[i++] = reddit;
urls[i++] = whatsapp;
urls[i++] = twitter;
urls[i++] = linkedin;
urls[i++] = tumblr;
urls[i++] = pinterest;
urls[i++] = blogger;
urls[i++] = livejournal;
urls[i++] = evernote;
urls[i++] = addthis;
urls[i++] = getpocket;
urls[i++] = hackernews;
urls[i++] = buffer;
urls[i++] = flipboard;
urls[i++] = instapaper;
urls[i++] = surfingbird;
urls[i++] = flattr;
urls[i++] = diaspora;
urls[i++] = qzone;
urls[i++] = vk;
urls[i++] = weibo;
urls[i++] = okru;
urls[i++] = douban;
urls[i++] = xing;
urls[i++] = renren;
urls[i++] = threema;
urls[i++] = sms;
urls[i++] = lineme;
urls[i++] = skype;
urls[i++] = telegramme;
urls[i++] = email;
urls[i++] = gmail;
urls[i++] = yahoo;
}
}
public class Application
{
public static void Main()
{
SocialMedia sm = new SocialMedia(
"EarthFluent",
"http%3A%2F%2Fwww.earthfluent.com%2F"
);
for (int i = 0; i < Globals.SOCIALMEDIASERVICES; i++)
{
Console.WriteLine(sm.servicesSortedByPopularity[i] + " : " + sm.urls[i]);
}
}
}