Recommend this page to a friend! |
Download .zip |
Info | Example | Demos | Screenshots | View files (4) | Download .zip | Reputation | Support forum (1) | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2016-07-09 (3 months ago) | 64% | Total: 128 This week: 3 | All time: 8,321 This week: 377 |
Version | License | PHP version | Categories | |||
phpstringsocializer 1.1 | GNU General Publi... | 5 | HTML, PHP 5, Text processing, Social ... |
Description | Author | |||
This class can replace text with hash tags and social media links. Innovation Award
|
StringSocializer is a simple PHP class that converts string into social media rich text. It add hashtags and mentions custimized for each social network
// Initialize Class
$stringSocializer = new stringSocializer();
// set original String
$originalString = 'El partido estaba igualado sin tantos hasta que el genio de Lionel Messi frotó la lámpara y sacó una jugada mágica de la galera para poner con remate cruzado el 1 a 0. tres minutos después una jugada velóz de Luis Suarez dejó solo a Neymar quien definió suave a la izquierda para decretar el 2 a 0 final.';
$stringSocializer->setOriginalString($originalString);
// Hashtags and Mentions for many social networks
$hashtags = array(
'facebook' => array(
array(
'title' => 'LeoMessi',
'mention' => 'LeoMessi',
'names' => array('/Lionel Messi/i')
),
array(
'title' => 'NeymarJr',
'mention' => 'Neymarjr',
'names' => array('/Neymar/i')
),
array(
'title' => 'LuisSuarez',
'mention' => 'Luis-Suarez-167866666571743',
'names' => array('/Luis Suarez/i')
)
),
'twitter' => array(
array(
'title' => 'Messi',
'hashtag' => 'Messi',
'names' => array('/Lionel Messi/i')
),
array(
'title' => 'NeymarJr',
'mention' => 'neymarjr',
'names' => array('/Neymar/i')
),
array(
'title' => 'LuisSuarez9',
'mention' => 'LuisSuarez9',
'names' => array('/Luis Suarez/i')
)
),
'instagram' => array(
array(
'title' => 'LeoMessi',
'mention' => 'leomessi',
'names' => array('/Lionel Messi/i')
),
array(
'title' => 'NeymarJr',
'mention' => 'neymarjr',
'names' => array('/Neymar/i')
),
array(
'title' => 'LuisSuarez9',
'mention' => 'LuisSuarez9',
'names' => array('/Luis Suarez/i')
)
),
'googleplus' => array(
array(
'title' => 'LeoMessi',
'hashtag' => 'LeoMessi',
'names' => array('/Lionel Messi/i')
),
array(
'title' => 'NeymarJr',
'mention' => '110543884226915019329',
'names' => array('/Neymar/i')
),
array(
'title' => 'LuisSuarez',
'mention' => '117508493298516511885',
'names' => array('/Luis Suarez/i')
)
),
'tumblr' => array(),
'pinterest' => array(),
);
$stringSocializer->setHashtags($hashtags);
// You can set the in html or text plain (optional)
$stringSocializer->setHtml(true);
// Socialize string
$stringSocializer->socializeString();
// Get the array result with the string customized for each social network
$arrayResult = $stringSocializer->getStringSocialized();
Screenshots | ||
Files |
File | Role | Description |
---|---|---|
composer.json | Data | Composer |
example.php | Example | Example |
README.md | Data | Readme |
stringSocializer.php | Class | Class |
phpstringsocializer-2016-07-09.zip 66KB | |
phpstringsocializer-2016-07-09.tar.gz 66KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
80% |
|
|
User Ratings | ||||||||||||||||||||||||||||||
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.