Social Networks Auto Poster (SNAP) API
This products is for: | Plain PHP, WordPress |
Compatible with: | Your own PHP Projects, WordPress |
Social Networks Auto Poster (SNAP) API is a universal API for the most popular social networks. SNAP API gives you an ability to make a beautifully formatted posts to the most popular social networks and CMS platforms by one simple call.
Why do we need that?
Universal API
Each social network and each CMS platform has it’s own API that different from one another. Right now you need to read through tons of specifications and documentation, learn how to make calls and sign or encode your requests for each network. That could take weeks and months of development time. Then when it’s done and it’s still not working, you will need to comb through forums, discussion groups, newsgroups, stackoverflow, etc. trying to figure out what you have done wrong. That will take even more time.
Well, we already done all that. We took every available API, learned how to work with it and as the result we combined then all in one universal package. You just make one simple API call and SNAP will post your message everywhere.
We actually did even more
API for the platforms without built-in API
There are some networks that don’t have a publicly available API. We created our own APIs for such networks.
Supported Platforms and Social Networks
1. Platforms/Social Networks based on the unique NextScripts API:
1.2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
2. Platforms/Social Networks based on the built-in APIs:
1.2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
Requirements
PHP Ver > 5.2
curlSSL
PHP should have at least 32M of memory (64M and more is highly recommended).
Get it
-
SNAP API Run-TimeEmbedded libraries
- $49
- /yr
Embedded libraries – Will work only from WordPress.
SNAP API Run-Time is not downloadable
It is available only as part of SNAP Pro Plugin for WordPress and other integrated solutions.Get it now:SNAP Pro Plugin for Joomla(Soon)
-
SNAP API ProFull Source API Libraries with management panel
- $99
- /yr
(available as beta)
Full Source API Libraries with management panel.*** Special Offer: Get “SNAP Pro Plugin for WordPress” free with “SNAP API Pro” purchase.
Get it now: -
SNAP API LightFull Source API Libraries
- $75
- /yr
(available as beta)
Only API libraries, no management panel*** Special Offer: Get “SNAP Pro Plugin for WordPress” free with “SNAP API Light” purchase.
Get it now:
Have some questions?
Please check the SNAP API FAQ or feel free to contact us.
Main Question: Can this product read my posts from my database? Can this product save/read my settings from my database? Can it post to multiple accounts simultaneously? Can I set the delay? Can I set a schedule to automatically repost my messages?
This product is an API. Simply API is a “black box” that you provide with the destination, credentials and message. API will post this message to your destination using your credentials. That’s it, nothing more, nothing less.
You can call it as many times as you like with different destination and credentials ad it will post to different accounts or pages. It’s up you if you would like to save login or not and where you do that. It doesn’t read your messages from the DB, it does not schedule posts or re-posts, it does not do any other functionality. API is a library that you can wrap your own code around.
Our WordPress plugin is a very good example of kind of code could be written around the API.
Terms FAQ
If you are interested in re-selling plugin or would like to install it for your clients you can look at our affiliate program (http://www.nextscripts.com/affiliates/) or developers/resell packages: (http://www.nextscripts.com/developer-and-resale-licenses/)
How to use it
1. Post simple text message to all your configured accounts:
<?php // First, let's get settings. $fileData = file_get_contents(dirname(__FILE__).'/nx-snap-settings.txt'); $snapOptions = maybe_unserialize($fileData); if (class_exists("cl_nxsAutoPostToSN")) { // Initialize the class $nxsAutoPostToSN = new cl_nxsAutoPostToSN($snapOptions); // Message array contains the post $message = array( 'title'=>'Social Networks Auto Poster (SNAP) API', 'text'=>'Social Networks Auto Poster (SNAP) API is a universal API for the most popular social networks', ); // Set message $nxsAutoPostToSN->setMessage($message); // Make the post $ret = $nxsAutoPostToSN->autoPost(); } ?>
2. Post a text message with attached link and specific image ONLY to the first and third Twitter accounts and to the first Facebook account:
<?php // First, let's get settings. $fileData = file_get_contents(dirname(__FILE__).'/nx-snap-settings.txt'); $snapOptions = maybe_unserialize($fileData); $postOnlyTo = array('tw'=>array(0, 2), 'fb'=>array(0)); if (class_exists("cl_nxsAutoPostToSN")) { // Initialize the class $nxsAutoPostToSN = new cl_nxsAutoPostToSN($snapOptions, $postOnlyTo); // Message array contains the post $message = array( 'url'=>'http://www.nextscripts.com/snap-api/', 'urlDescr'=>'Social Networks Auto Poster (SNAP) API', 'urlTitle'=>'Social Networks Auto Poster API', 'imageURL' => array( 'large'=>'http://www.nextscripts.com/images/SNAP-Logo_Big_SQ.png' ), 'title'=>'Social Networks Auto Poster (SNAP) API', 'text'=>'Social Networks Auto Poster (SNAP) API is a universal API for the most popular social networks', ); // Set message $nxsAutoPostToSN->setMessage($message); // Make the post $ret = $nxsAutoPostToSN->autoPost(); } ?>
3. You can also just post directly to individual networks. You can do it even without settings array. Here is the example of how to post a simple message to your Google Plus Business Page Stream: (more examples of using it with Google+ only are here Google+ Automated Posting)
<?php require_once "nxs-api/nxs-api.php"; require_once "nxs-api/nxs-http.php"; require_once "inc/nxs-functions.php"; $email = 'YourEmail@gmail.com'; $pass = 'YourPassword'; $pageID = '109888164682746252347'; $msg = 'Post this to Google Plus!'; $nt = new nxsAPI_GP(); $loginError = $nt->connect($email, $pass); if (!$loginError) { $result = $nt -> postGP($msg, '', $pageID); } else echo $loginError; if (!empty($result) && is_array($result) && !empty($result['post_url'])) echo '<a target="_blank" href="'.$result['post_url'].'">New Post</a>'; else echo "<pre>".print_r($result, true)."</pre>"; ?>
Here is how to post to Twitter:
<?php require_once "nxs-api/nxs-http.php"; require_once "inc/nxs-functions.php"; require_once "inc-cl/tw.api.php"; $message = array(); $message['text'] = 'Test Post'; $message['imageURL'] = 'http://www.nextscripts.com/imgs/nextscripts.png'; $TWoptions = array(); $TWoptions['twURL'] = 'https://twitter.com/YourTWPage'; $TWoptions['twConsKey'] = 'KEY'; $TWoptions['twConsSec'] = 'SEC'; $TWoptions['twAccToken'] = 'TTT-TOK'; $TWoptions['twAccTokenSec'] = 'TOKSEC'; $TWoptions['twMsgFormat'] = '%TEXT%'; $TWoptions['attchImg'] = '1'; $ntToPost = new nxs_class_SNAP_TW(); $result = $ntToPost->doPostToNT($TWoptions, $message); if (!empty($result) && is_array($result) && !empty($result['postURL'])) echo '<a target="_blank" href="'.$result['postURL'].'">New Post</a>'; else echo "<pre>".print_r($result, true)."</pre>"; ?>
Here is how to post to Facebook:
<?php require_once "nxs-api/nxs-http.php"; require_once "inc/nxs-functions.php"; require_once "inc-cl/fb.api.php"; $message = array(); $message['text'] = 'Test Post'; $message['imageURL'] = 'http://www.nextscripts.com/imgs/nextscripts.png'; $message['url'] = 'http://www.nextscripts.com/snap-features/assign-categories-to-each-social-network/'; $NToptions = array(); $NToptions['fbURL'] = 'https://www.facebook.com/MYFBPAGE'; $NToptions['fbAppID'] = 'APPID'; $NToptions['fbAppSec'] = 'SEC'; $NToptions['fbAppAuthToken'] = 'user_token'; $NToptions['fbAppPageAuthToken'] = 'page_token'; $NToptions['postType'] = 'A'; $ntToPost = new nxs_class_SNAP_FB(); $result = $ntToPost->doPostToNT($NToptions, $message); if (!empty($result) && is_array($result) && !empty($result['postURL'])) echo '<a target="_blank" href="'.$result['postURL'].'">New Post</a>'; else echo "<pre>".print_r($result, true)."</pre>"; ?>
Management Panel Screenshots
General View:
Account Details View: