-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
amp-social-share-config.js
86 lines (85 loc) · 1.8 KB
/
amp-social-share-config.js
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
/**
* Get social share configurations by supported type.
* @param {string} type
* @return {!Object}
*/
export function getSocialConfig(type) {
return BUILTINS[type];
}
/**
* @type {!JsonObject}
*/
const BUILTINS = {
'twitter': {
'shareEndpoint': 'https://twitter.com/intent/tweet',
'defaultParams': {
'text': 'TITLE',
'url': 'CANONICAL_URL',
},
},
'facebook': {
'shareEndpoint': 'https://www.facebook.com/dialog/share',
'defaultParams': {
'href': 'CANONICAL_URL',
},
},
'pinterest': {
'shareEndpoint': 'https://www.pinterest.com/pin/create/button/',
'defaultParams': {
'url': 'CANONICAL_URL',
'description': 'TITLE',
},
},
'linkedin': {
'shareEndpoint': 'https://www.linkedin.com/shareArticle',
'defaultParams': {
'url': 'CANONICAL_URL',
'mini': 'true',
},
},
'gplus': {
'obsolete': true,
},
'email': {
'bindings': ['recipient'],
'shareEndpoint': 'mailto:RECIPIENT',
'defaultParams': {
'subject': 'TITLE',
'body': 'CANONICAL_URL',
'recipient': '',
},
},
'tumblr': {
'shareEndpoint': 'https://www.tumblr.com/share/link',
'defaultParams': {
'name': 'TITLE',
'url': 'CANONICAL_URL',
},
},
'whatsapp': {
'shareEndpoint': 'https://api.whatsapp.com/send',
'defaultParams': {
'text': 'TITLE - CANONICAL_URL',
},
},
'line': {
'shareEndpoint': 'https://social-plugins.line.me/lineit/share',
'defaultParams': {
'text': 'TITLE',
'url': 'CANONICAL_URL',
},
},
'sms': {
'shareEndpoint': 'sms:',
'defaultParams': {
'body': 'TITLE - CANONICAL_URL',
},
},
'system': {
'shareEndpoint': 'navigator-share:',
'defaultParams': {
'text': 'TITLE',
'url': 'CANONICAL_URL',
},
},
};