All Projects → oscarotero → Social Links

oscarotero / Social Links

Simple library to count shares and generate share buttons

Projects that are alternatives of or similar to Social Links

Simplesharingbuttons
Share to Facebook, Twitter, Google+ and other social networks using simple HTML buttons.
Stars: ✭ 147 (+61.54%)
Mutual labels:  share, twitter, facebook
Share Selected Text
share selected text on twitter, buffer, and some others. Inspired by medium.com
Stars: ✭ 64 (-29.67%)
Mutual labels:  share, twitter, facebook
Puppeteer Social Image
Create dynamic social share images using HTML + CSS via puppeteer 🎁
Stars: ✭ 141 (+54.95%)
Mutual labels:  opengraph, twitter, facebook
node-htmlmetaparser
A `htmlparser2` handler for parsing rich metadata from HTML. Includes HTML metadata, JSON-LD, RDFa, microdata, OEmbed, Twitter cards and AppLinks.
Stars: ✭ 44 (-51.65%)
Mutual labels:  metadata, facebook, twitter
The Seo Framework
The SEO Framework WordPress plugin.
Stars: ✭ 329 (+261.54%)
Mutual labels:  opengraph, metadata, twitter
Vuepress Plugin Social Share
📣 Social sharing plugin for VuePress
Stars: ✭ 27 (-70.33%)
Mutual labels:  share, twitter, facebook
Ultimate Metatags
A large snippet for your page's <head> that includes all the meta tags you'll need for OPTIMAL sharing and SEO. Extensive work has been put into ensuring you have the optimal images for the most important social media platforms.
Stars: ✭ 24 (-73.63%)
Mutual labels:  opengraph, twitter, facebook
React Share Button
📱 React share button component with web-share api and fallback modal with native intent urls
Stars: ✭ 89 (-2.2%)
Mutual labels:  share, twitter, facebook
Wordpress Seo
Yoast SEO for WordPress
Stars: ✭ 1,301 (+1329.67%)
Mutual labels:  opengraph, metadata
Nemiro.oauth.dll
Nemiro.OAuth is a class library for authorization via OAuth protocol in .NET Framework
Stars: ✭ 45 (-50.55%)
Mutual labels:  twitter, facebook
Imageviewer.swift
An easy to use Image Viewer that is inspired by Facebook
Stars: ✭ 1,071 (+1076.92%)
Mutual labels:  twitter, facebook
Yoast Seo For Typo3
Yoast SEO plugin for TYPO3
Stars: ✭ 43 (-52.75%)
Mutual labels:  opengraph, metadata
Social Post Bundle
Symfony bundle to publish status updates on Facebook, LinkedIn and Twitter.
Stars: ✭ 35 (-61.54%)
Mutual labels:  twitter, facebook
Keyring
Keyring is an authentication framework for WordPress. It comes with definitions for a variety of HTTP Basic, OAuth1 and OAuth2 web services. Use it as a common foundation for working with other web services from within WordPress code.
Stars: ✭ 52 (-42.86%)
Mutual labels:  twitter, facebook
Feeds
Importiert Daten aus API-Quellen wie Facebook, Instagram, Twitter, YouTube, Vimeo oder RSS (ehemals YFeed)
Stars: ✭ 34 (-62.64%)
Mutual labels:  twitter, facebook
Grain
The Entire History of You
Stars: ✭ 30 (-67.03%)
Mutual labels:  twitter, facebook
Bash2mp4
Video Downloader for Termux .
Stars: ✭ 68 (-25.27%)
Mutual labels:  twitter, facebook
Skraper
Kotlin/Java library and cli tool for scraping posts and media from various sources with neither authorization nor full page rendering (Facebook, Instagram, Twitter, Youtube, Tiktok, Telegram, Twitch, Reddit, 9GAG, Pinterest, Flickr, Tumblr, IFunny, VK, Pikabu)
Stars: ✭ 72 (-20.88%)
Mutual labels:  twitter, facebook
Network Avatar Picker
A npm module that returns user's social network avatar. Supported providers: facebook, instagram, twitter, tumblr, vimeo, github, youtube and gmail
Stars: ✭ 74 (-18.68%)
Mutual labels:  twitter, facebook
Django Graphql Social Auth
Python Social Auth support for Graphene Django
Stars: ✭ 90 (-1.1%)
Mutual labels:  twitter, facebook

SocialLinks

Scrutinizer Code Quality Build Status

Created by Oscar Otero http://oscarotero.com [email protected]

This is a simple library to generate buttons to share an url or count the current shares using multiple providers (facebook, twitter, etc) It also generate the appropiate meta tags to insert in the <head>

Usage

use SocialLinks\Page;

//Create a Page instance with the url information
$page = new Page([
    'url' => 'http://mypage.com',
    'title' => 'Page title',
    'text' => 'Extended page description',
    'image' => 'http://mypage.com/image.png',
    'icon' => 'http://mypage.com/favicon.png',
    'twitterUser' => '@twitterUser'
]);

//Use the properties to get the providers info, for example:
$facebookProvider = $page->facebook;

//Each provider has the following info:
$page->twitter->shareUrl; //The url to share this page  (returns null if is not available)
$page->twitter->shareCount; //The number of the current shares (returns null if is not available)

//Example
$link = '<a href="%s">%s (%s)</a>';

printf($link, $page->facebook->shareUrl, 'Share in Facebook', $page->facebook->shareCount);
printf($link, $page->twitter->shareUrl, 'Share in Twitter', $page->twitter->shareCount);
printf($link, $page->plus->shareUrl, 'Share in Google Plus', $page->plus->shareCount);
printf($link, $page->pinterest->shareUrl, 'Share in Pinterest', $page->pinterest->shareCount);
printf($link, $page->linkedin->shareUrl, 'Share in Linkedin', $page->linkedin->shareCount);
printf($link, $page->stumbleupon->shareUrl, 'Share StumbleUpon', $page->stumbleupon->shareCount);

Preload share counters

When you use, for example $page->facebook->shareCount, a request to facebook API is executed. This means that if you need also $page->linkedin->shareCount and $page->plus->shareCount, three requests are required. To improve performance, you can execute all these requests in parallel. Example:

$page = newPage(['url' => 'http://page.com']);

//Preload the counters
$page->shareCount(['linkedin', 'facebook', 'plus']);

//Use them
echo $page->facebook->shareCount;
echo $page->linkedin->shareCount;
echo $page->plus->shareCount;

Providers supported

Name Counter
blogger -
bobrdobr -
cabozo -
chuza YES
classroom -
delicious -
digg -
email -
evernote -
facebook YES
line -
linkedin YES
liveinternet -
livejournal -
mailru YES
meneame YES
odnoklassniki YES
pinterest -
plus YES
pocket -
reddit YES
scoopit YES
sms -
stumbleupon YES
telegram -
tumblr -
twitter -
viadeo -
vk -
whatsapp -
xing YES

Generate social meta tags

You can use this library to generate also the tags for opengraph, twitter cards, etc. Example:

//$page is the same variable than the example above

//Use magic methods (instead magic properties) to get the objects with specific metas:
$card = $page->twitterCard();

//The object is traversable:
foreach($card as $tag) {
    echo $tag;
}

//You can get each tag by it's name (without prefix)
echo $card['card']; //<meta property="twitter:card" content="Summary">

//Add/edit more metas
$card->addMeta('author', '@the_author'); //<meta property="twitter:author" content="@the_autor">

Meta supported

  • html
  • openGraph
  • twitterCard
  • schema

Usage in Symfony

There is a Symfony bundle available here: https://github.com/astina/AstinaSocialLinksBundle

Contributions

  • All code must be PSR-1 and PSR-2 compilance. You can use this php cs-fixer
  • The providers class names must be in lowercase starting by uppercase. For example Linkedin instead LinkedIn.
  • Add the new providers to demo/index.php

Thanks to:

  • peric For adding Email provider and some fixes
  • eusonlito For some fixes
  • perk for adding new providers
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].