The Social Share Code Libraries project provides source code libraries for writing code that uses sharing on social-media.
All code is released under the permissive BSD-3-Clause License, so you should be able to use it in any of your projects, even if they are not permissively licensed like the BSD-3-Clause License.
This is a sub-project of Social Share URL's, a project for documenting the sharing URL API's of third-party, social-media websites. Check out more about us here :
https://github.com/bradvin/social-share-urls
Online Demo
:
- Mikhail Bakunin : God and the State
- EarthFluent.com : Learn French Online
- List Keywords : Finding and Listing Your Keywords For You
Code Sandbox
:
Sample Use
:
$socmed = new SocialMedia();
$social_media_names = $socmed->GetSocialMediaSites_WithShareLinks_OrderedByPopularity();
$social_media_urls = $socmed->GetSocialMediaSiteLinks_WithShareLinks([
url=>'http://www.earthfluent.com/',
title=>'EarthFluent',
]);
foreach($social_media_names as $social_media_name) {
$social_media_url = $social_media_urls[$social_media_name];
print($social_media_name . ' : ' . $social_media_url . "\n\n");
}
Library Files
:
Online Demo
:
- Peter Kropotkin : The Conquest of Bread
- EarthFluent.com : Learn Portuguese Online
- List Keywords : Finding and Listing Your Keywords For You
Code Sandbox
:
Sample Use
:
sm = SocialMedia()
#socialmediasites = sm.GetSocialMediaSites_WithShareLinks_OrderedByAlphabet()
socialmediasites = sm.GetSocialMediaSites_WithShareLinks_OrderedByPopularity()
socialmediaurls = sm.GetSocialMediaSiteLinks_WithShareLinks({
'url':'http://www.earthfluent.com/',
'title':'EarthFluent',
})
#print(socialmediaurls.keys())
for socialmediasite in socialmediasites:
print(socialmediasite + " : " + socialmediaurls[socialmediasite])
pass
Library Files
:
Online Demo
:
- EarthFluent.com : Learn Spanish Online
- Alexander Berkman : Prison Memoirs of an Anarchist
- Sort Words : Sort Words : Sorting Your Lists of Words For You
Code Sandbox
:
Sample Use
:
class main {
public static void main (String[] args) {
SocialMedia sm = new SocialMedia();
Map<String, String> socialmediaargs = new HashMap<String, String>(){{
put("url", "http://www.earthfluent.com/");
put("title", "EarthFluent");
}};
Map<String, String> socialmediasites = sm.GetSocialMediaSiteLinks_WithShareLinks(socialmediaargs);
for (String socialmedia : sm.GetSocialMediaSites_WithShareLinks_OrderedByPopularity()) {
System.out.println(socialmedia + " : " + socialmediasites.get(socialmedia));
}
}
}
Library Files
:
Online Demo
:
- Peter Kropotkin : Ethics: Origin and Development
- EarthFluent.com : Learn Indonesian Online
- List Keywords : Finding and Listing Your Keywords For You
Code Sandbox
:
Sample Use
:
func SocialMediaDefault() SocialMedia {
sm := SocialMedia{
title:"EarthFluent",
url:"http%3A%2F%2Fwww.earthfluent.com%2F",
desc:"Want%20to%20learn%20another%20language%3F%20%20Learn%20Spanish%2C%20French%2C%20Italian%2C%20German%2C%20Japanese%2C%20Chinese%2C%20Hindi%2C%20Indonesian%2C%20Dutch%2C%20Polish%2C%20Portuguese%2C%20or%20Russian%21",
}
return sm
}
func main(){
sm := SocialMediaInterface()
for i := 0; i < 37; i++ {
fmt.Println(sm.urlsOrderedByPopularity[i] + " : " + sm.urls[i]);
}
}
Library Files
:
Online Demo
:
- EarthFluent.com : Learn Chinese Online
- Lucy Parsons : The Principles of Anarchism
- Remove Blank Lines : Removing Blank Lines from Lists
Code Sandbox
:
Sample Use
:
<SocialShareMedia
url="http://www.earthfluent.com/"
title="EarthFluent"
/>
Library Files
:
- /code/reactjs/package.json
- /code/reactjs/public/index.html
- /code/reactjs/src/SocialShareMedia.js
- /code/reactjs/src/index.js
- /code/reactjs/src/styles.css
Online Demo
:
- EarthFluent.com : Social Share Media JavaScript Demo
- EarthFluent.com : Learn Japanese Online
- Peter Kropotkin : The Great French Revolution
- Remove Duplicate Lines : Removing Duplicate Entries from Lists
Code Sandbox
:
- JSBin.com : Social Share Media Javascript Demo
- IdeOne.com : Does Not Compile, Unknown Error.
- CodeSandbox.io : Does Not Compile, Unknown Error.
Sample Use
:
const socialmedia = GetSocialMediaSites_WithShareLinks_OrderedByPopularity();
const socialmediaurls = GetSocialMediaSiteLinks_WithShareLinks({
'url':$('#input_url').val(),
'title':$('#input_title').val(),
});
var children = [];
for(var i = 0; i < socialmedia.length; i++) {
const socialmedium = socialmedia[i];
children.push(
'<tr><td class="output-label">' +
socialmedium +
'</td><td>' +
socialmediaurls[socialmedium] +
'</td></tr>'
);
}
$('#output-table').empty();
$('#output-table').append(children.join());
Library Files
:
- /code/javascript/social-share-media.html
- /code/javascript/css/social-share-media.css
- /code/javascript/javascript/social-share-media.js
Online Demo
:
- Peter Kropotkin : Memoirs of a Revolutionist
- EarthFluent.com : Learn Japanese Online
- List Keywords : Finding and Listing Your Keywords For You
Code Sandbox
:
Sample Use
:
int main() {
SocialMedia sm;
for(int i = 0; i < SOCIALMEDIASERVICES; i++) {
printf("%s", sm.urlsOrderedByPopularity[i]);
printf(" : ");
printf("%s", sm.urls[i]);
printf("\n");
}
return 0;
}
Library Files
:
Online Demo
:
- Emma Goldman : Anarchism, What it Really Stands For
- EarthFluent.com : Learn Chinese Online
- List Keywords : Finding and Listing Your Keywords For You
Code Sandbox
:
Sample Use
:
int main(void) {
SocialMedia sm = buildUrls();
for(int i = 0; i < SOCIALMEDIASERVICES; i++) {
printf("%s", sm.urlsOrderedByPopularity[i]);
printf(" : ");
printf("%s", sm.urls[i]);
printf("\n");
}
return 0;
}
Library Files
:
Online Demo
:
- Peter Kropotkin : Fields, Factories, and Workshops
- EarthFluent.com : Learn Hindi Online
- List Keywords : Finding and Listing Your Keywords For You
Code Sandbox
:
Sample Use
:
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]);
}
}
}
Library Files
:
Online Demo
:
- Peter Kropotkin : Modern Science and Anarchism
- EarthFluent.com : Learn Korean Online
- Sort Words : Sorting Your Lists of Words For You
Code Sandbox
:
Sample Use
:
sm = SocialMedia.new
socialmediaurls = sm.GetSocialMediaSiteLinks_WithShareLinks({
'title'=>'EarthFluent',
'url'=>'http://www.earthfluent.com/',
})
sm.GetSocialMediaSites_WithShareLinks_OrderedByPopularity().each{
|socialmedia|
puts socialmedia + ' : ' + socialmediaurls[socialmedia]
}
Library Files
:
Online Demo
:
- Murray Bookchin : Society and Ecology
- EarthFluent.com : Learn Russian Online
- Remove Spacing : Removing Spaces and Spacing from Your Text
Code Sandbox
:
Sample Use
:
my @social_media_names = @{GetSocialMediaSites_WithShareLinks_OrderedByPopularity() || []};
my $social_media_urls = GetSocialMediaSiteLinks_WithShareLinks({
url=>'https://www.earthfluent.com/',
title=>'EarthFluent',
});
foreach my $social_media_name(@social_media_names) {
my $social_media_url = $social_media_urls->{$social_media_name};
print($social_media_name . ' : ' . $social_media_url . "\n\n");
}
Library Files
:
Online Demo
:
- Peter Kropotkin : The Industrial Village of the Future
- EarthFluent.com : Learn Polish Online
- List Keywords : Finding and Listing Your Keywords For You
Code Sandbox
:
Sample Use
:
Public Class App
Public Shared Sub Main()
Dim sm As New SocialMedium(
"EarthFluent",
"http%3A%2F%2Fwww.earthfluent.com%2F",
"Want%20to%20learn%20another%20language%3F%20%20Learn%20Spanish%2C%20French%2C%20Italian%2C%20German%2C%20Japanese%2C%20Chinese%2C%20Hindi%2C%20Indonesian%2C%20Dutch%2C%20Polish%2C%20Portuguese%2C%20or%20Russian%21",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
)
For index As Integer = 0 To 36
Console.WriteLine(sm.urlsOrderedByPopularity(index) + " : " + sm.urls(index))
Next
Console.WriteLine(sm.urlsOrderedByPopularity(0))
End Sub
End Class
Library Files
:
Online Demo
:
- Peter Kropotkin : Mutual Aid : A Factor of Evolution
- EarthFluent.com : Learn German Online
- List Keywords : Finding and Listing Your Keywords For You
Code Sandbox
:
Sample Use
:
var sm:SocialMedia = SocialMedia(
url: "http%3A%2F%2Fwww.earthfluent.com%2F",
title: "EarthFluent",
image: "",
desc: "",
appid: "",
redirecturl: "",
via: "",
hash_tags: "",
provider: "",
language: "",
user_id: "",
category: "",
phone_number: "",
email_address: "",
cc_email_address: "",
bcc_email_address: ""
)
for index in 0..<sm.servicesSortedByPopularity.count{
var service = sm.servicesSortedByPopularity[index];
var url = sm.urls[index];
print(service + " : " + url);
}
Library Files
:
Online Demo
:
- Peter Kropotkin : Wars and Capitalism
- EarthFluent.com : Learn Japanese Online
- Sort Words : Sorting Your Lists of Words For You
Code Sandbox
:
Sample Use
:
SocialMedia *sm = [[SocialMedia alloc]init];
int i;
for(i = 0; i < SOCIALMEDIASERVICES; i++) {
NSString *socialmedia = [sm.urlsOrderedByPopularity objectAtIndex: i];
NSString *socialmediaurl= [sm.urls objectAtIndex: i];
printf("%s", [socialmedia UTF8String]);
printf(" : ");
printf("%s", [socialmediaurl UTF8String]);
printf("\n");
}
return 0;
Library Files
: