Changeset 2758241
- Timestamp:
- 07/18/2022 11:55:48 PM (4 years ago)
- Location:
- social-networks-auto-poster-facebook-twitter-g/trunk
- Files:
-
- 10 edited
-
NextScripts_SNAP.php (modified) (2 diffs)
-
inc-cl/apis/xmlrpc-client.php (modified) (2 diffs)
-
inc-cl/lj.api.php (modified) (1 diff)
-
inc-cl/lj.php (modified) (1 diff)
-
inc-cl/tg.api.php (modified) (1 diff)
-
inc-cl/tg.php (modified) (2 diffs)
-
inc-cl/tw.api.php (modified) (4 diffs)
-
inc/nxs_class_http.php (modified) (1 diff)
-
inc/nxs_class_ntlist.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
social-networks-auto-poster-facebook-twitter-g/trunk/NextScripts_SNAP.php
r2757419 r2758241 5 5 Description: This plugin automatically publishes posts from your blog to your social media accounts on Twitter, FB, Telegram, LinkedIn, and 25 more networks. 6 6 Author: NextScripts 7 Version: 4.3.2 87 Version: 4.3.29 8 8 Author URI: https://www.nextscripts.com 9 9 Text Domain: social-networks-auto-poster-facebook-twitter-g … … 11 11 */ 12 12 13 define( 'NextScripts_SNAP_Version' , '4.3.2 8' ); define( 'NextScripts_SNAP_Version_Date' , 'July 16, 2022' ); require_once "inc/nxs_functions_wp.php"; if(!defined( 'NXSSNAP_BASENAME' ) ) define( 'NXSSNAP_BASENAME', plugin_basename( __FILE__ ) );13 define( 'NextScripts_SNAP_Version' , '4.3.29' ); define( 'NextScripts_SNAP_Version_Date' , 'July 18, 2022' ); require_once "inc/nxs_functions_wp.php"; if(!defined( 'NXSSNAP_BASENAME' ) ) define( 'NXSSNAP_BASENAME', plugin_basename( __FILE__ ) ); 14 14 15 if (true===nxs_doSystemInitCheck()) { // error_reporting(E_ALL); ini_set('display_errors', '1');15 if (true===nxs_doSystemInitCheck()) { // error_reporting(E_ALL); ini_set('display_errors', '1'); 16 16 require_once "inc/nxs_functions.php"; require_once "inc/nxs_functions_adv.php"; require_once "inc/nxs_functions_engine.php"; require_once "inc/nxs_class_http.php"; 17 17 require_once "inc/nxs_class_snap.php"; require_once "inc/nxs_class_flt.php"; require_once "inc/nxs_class_mgmt.php"; require_once "inc/nxs_class_ntlist.php"; require_once "inc/nxs_class_oauth.php"; -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/apis/xmlrpc-client.php
r2757212 r2758241 399 399 var $debug = false; 400 400 var $timeout; 401 var $proxy = []; 401 402 402 403 // Storage place for an error message … … 530 531 $rq = new nxsHttp2; 531 532 $url = 'https://' . $this->server . ':' . $this->port . $this->path; 532 $argArr['flds'] = $xml; $argArr['extraHeaders']['Content-Type'] = 'text/xml'; 533 $args = nxs_mkRmReqArgs($argArr); $ret = $rq->request($url, $args); 533 $argArr['flds'] = $xml; $argArr['extraHeaders']['Content-Type'] = 'text/xml'; if (!empty($this->proxy)) $argArr['proxy'] = $this->proxy; 534 $args = nxs_mkRmReqArgs($argArr); $ret = $rq->request($url, $args); //prr($args); 534 535 $contents = is_array($ret)?$ret['body']:''; $err = $ret['response']['code']; 535 536 -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/lj.api.php
r1968023 r2758241 30 30 31 31 require_once ('apis/xmlrpc-client.php'); if (!empty($options['ljSrv']) && $options['ljSrv']=='DW') $server = 'dreamwidth.org'; else $server = 'livejournal.com'; 32 $nxsToLJclient = new NXS_XMLRPC_Client('https://www.'.$server.'/interface/xmlrpc'); $nxsToLJclient->debug = false; 33 34 $msg = preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', "", $msg); 32 $nxsToLJclient = new NXS_XMLRPC_Client('https://www.'.$server.'/interface/xmlrpc'); $nxsToLJclient->debug = false;// prr($options); 33 if (!empty($options['proxy'])&&!empty($options['proxyOn'])){ $nxsToLJclient->proxy['proxy'] = $options['proxy']['proxy']; if (!empty($options['proxy']['up'])) $nxsToLJclient->proxy['up'] = $options['proxy']['up']; } 34 35 $msg = preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', "", $msg); 35 36 36 37 $date = !empty($message['postDate']) ? strtotime($message['postDate']) : time(); $year = date("Y", $date); $mon = date("m", $date); $day = date("d", $date); $hour = date("G", $date); $min = date("i", $date); -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/lj.php
r2757212 r2758241 50 50 <br/ ><?php 51 51 } 52 function advTab($ii, $options){ }52 function advTab($ii, $options){$this->showProxies($this->ntInfo['lcode'], $ii, $options);} 53 53 //#### Set Unit Settings from POST 54 54 function setNTSettings($post, $options){ -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tg.api.php
r1968023 r2758241 31 31 if (substr($options['whToPost'],0,1)=='g') $options['whToPost'] = substr_replace($options['whToPost'], '-',0,1); //## Fix for Groups ID 32 32 //## Attach Image (Upload from tmp was here before version 4) 33 if ( $options['attchImg']=='1') { $url = 'https://api.telegram.org/bot'.$options['botTkn'].'/sendPhoto';34 $flds = array( 'chat_id' => $options['whToPost'],'photo' => $imgURL, 'caption' => '' );33 if ((!empty($options['postType'])&&$options['postType']=='I') || $options['attchImg']=='1') { $url = 'https://api.telegram.org/bot'.$options['botTkn'].'/sendPhoto'; 34 $flds = array( 'chat_id' => $options['whToPost'],'photo' => $imgURL, 'caption' => (!empty($options['postType'])&&$options['postType']=='I')?$msg:'', 'parse_mode' => 'HTML', 'disable_web_page_preview' => $options['webPrev']=='0' ); 35 35 $hdrsArr = $this->nxs_getHeaders('https://api.telegram.org', true); 36 $advSet = nxs_mkRemOptsArr($hdrsArr, '', $flds, $proxy); $ret = nxs_remote_post( $url, $advSet); if (is_nxs_error($ret)) { $badOut = print_r($ret, true)." - ERROR"; return $badOut; } 37 } 38 $msg = str_ireplace('<strong>','<b>',str_ireplace('</strong>','</b>',str_ireplace('<em>','<i>',str_ireplace('</em>','</i>',$msg)))); $msg = nsTrnc(strip_tags($msg, '<b><i><a><code><pre>'), 3000); $url = 'https://api.telegram.org/bot'.$options['botTkn'].'/sendMessage'; 39 $flds = array('chat_id' => $options['whToPost'], 'text' => $msg, 'parse_mode' => 'HTML', 'disable_web_page_preview' => $options['webPrev']=='0'); $hdrsArr = $this->nxs_getHeaders('https://api.telegram.org', true); 40 $advSet = nxs_mkRemOptsArr($hdrsArr, '', $flds, $proxy); $ret = nxs_remote_post( $url, $advSet); if (is_nxs_error($ret)) { $badOut = print_r($ret, true)." - ERROR"; return $badOut; } 41 $contents = $ret['body']; $resp = json_decode($contents, true); // prr($resp); 42 if (is_array($resp) && !empty($resp['ok']) && $resp['ok'] == 1 ) { if (empty($resp['result']['chat']['username'])) $purl = 'https://web.telegram.org/#/im?p='.str_replace('-','g',$resp['result']['chat']['id']); else $purl = 'http://telegram.me/'.$resp['result']['chat']['username']; 43 return array('postID'=>$resp['result']['message_id'], 'isPosted'=>1, 'postURL'=>$purl, 'pDate'=>date('Y-m-d H:i:s')); 44 } else $badOut['Error'] .= 'Something went wrong - '.print_r($ret, true); 36 $advSet = nxs_mkRemOptsArr($hdrsArr, '', $flds, $proxy); $ret = nxs_remote_post( $url, $advSet); if (is_nxs_error($ret)) { $badOut = print_r($ret, true)." - ERROR"; return $badOut; } 37 38 } 39 if (empty($options['postType'])||$options['postType']=='T') { 40 $msg = str_ireplace('<strong>','<b>',str_ireplace('</strong>','</b>',str_ireplace('<em>','<i>',str_ireplace('</em>','</i>',$msg)))); $msg = nsTrnc(strip_tags($msg, '<b><i><a><code><pre>'), 3000); $url = 'https://api.telegram.org/bot'.$options['botTkn'].'/sendMessage'; 41 $flds = array('chat_id' => $options['whToPost'], 'text' => $msg, 'parse_mode' => 'HTML', 'disable_web_page_preview' => $options['webPrev']=='0'); $hdrsArr = $this->nxs_getHeaders('https://api.telegram.org', true); 42 $advSet = nxs_mkRemOptsArr($hdrsArr, '', $flds, $proxy); $ret = nxs_remote_post( $url, $advSet); if (is_nxs_error($ret)) { $badOut = print_r($ret, true)." - ERROR"; return $badOut; } 43 } 44 $contents = $ret['body']; $resp = json_decode($contents, true); // prr($resp); 45 if (is_array($resp) && !empty($resp['ok']) && $resp['ok'] == 1 ) { if (empty($resp['result']['chat']['username'])) $purl = 'https://web.telegram.org/#/im?p='.str_replace('-','g',$resp['result']['chat']['id']); else $purl = 'http://telegram.me/'.$resp['result']['chat']['username']; 46 return array('postID'=>$resp['result']['message_id'], 'isPosted'=>1, 'postURL'=>$purl, 'pDate'=>date('Y-m-d H:i:s')); 47 } else $badOut['Error'] .= 'Something went wrong - '.print_r($ret, true); 45 48 return $badOut; 46 49 } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tg.php
r2757212 r2758241 16 16 <div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Channel ID, Group ID or Chat ID', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="tg[<?php echo esc_attr($ii); ?>][whToPost]" style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['whToPost'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 17 17 <br/><?php $this->elemMsgFormat($ii,'Message Format','msgFormat',$options['msgFormat']); ?> 18 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 19 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]" <?php if ((int)$options['webPrev'] == 1) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 18 19 <input type="radio" name="tg[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if (empty($options['postType']) || $options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 20 <div style="margin: 0px;margin-left: 20px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post (as a separate post)', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 21 <div style="margin: 0px;margin-left: 20px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]" <?php if ((int)$options['webPrev'] == 1) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 22 23 <input type="radio" name="tg[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if (!empty($options['postType']) && $options['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Upload image along with the text message.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 20 24 <br/><?php 21 25 } … … 64 68 65 69 <div class="nxsPostEd_ElemWrap"> 66 <div class="nxsPostEd_Elem"> 67 <div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]"/> 70 <div class="nxsPostEd_Elem"> 71 <input type="radio" class="nxsEdElem" name="tg[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if (empty($ntOpt['postType']) || $ntOpt['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 72 <div style="margin: 0px;margin-left: 20px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]"/> 68 73 <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if (!empty($ntOpt['webPrev'])) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 69 <div style="margin: 0px; "><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"/>74 <div style="margin: 0px;margin-left: 20px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"/> 70 75 <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if (!empty($ntOpt['attchImg'])) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 76 77 <input type="radio" class="nxsEdElem" name="tg[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if (!empty($ntOpt['postType']) && $ntOpt['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Upload image along with the text message.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 71 78 </div> 72 79 </div><?php -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tw.api.php
r2757419 r2758241 13 13 } 14 14 15 function doPostToNT($options, $message){ global $nxs_urlLen; $ badOut = array('pgID'=>'', 'isPosted'=>0, 'pDate'=>date('Y-m-d H:i:s'), 'Error'=>'');15 function doPostToNT($options, $message){ global $nxs_urlLen; $out = array('pgID'=>'', 'isPosted'=>0, 'pDate'=>date('Y-m-d H:i:s'), 'Error'=>''); 16 16 if (!function_exists('nxs_remote_get') && function_exists('nxs_remote_get')) { function nxs_remote_get($url){return nxs_remote_get($url);} } 17 17 if (!function_exists('is_nxs_error') && function_exists('is_nxs_error')) { function is_nxs_error($a){return is_nxs_error($a);} } 18 18 //## Check settings 19 if (!is_array($options)) { $ badOut['Error'] = 'No Options'; return $badOut; }20 if (!isset($options['accessToken']) || trim($options['accessToken'])=='') { $ badOut['Error'] = 'No Auth Token Found'; return $badOut; }19 if (!is_array($options)) { $out['Error'] = 'No Options'; return $out; } 20 if (!isset($options['accessToken']) || trim($options['accessToken'])=='') { $out['Error'] = 'No Auth Token Found'; return $out; } 21 21 if (empty($options['imgSize'])) $options['imgSize'] = ''; 22 22 //## Old Settings Fix … … 34 34 } 35 35 $twLim = 280; if ($nxs_urlLen>0) { $msg = nsTrnc($msg, $twLim-22+$nxs_urlLen); } else $msg = nsTrnc($msg, $twLim); if (substr($msg, 0, 1)=='@') $msg = ' '.$msg; 36 $params_array = array('text' =>$msg); $mid = ''; $appi = new nxsAPI_TW_Native(); $appi->conn = $options; $ badOut = $appi->check(); if ($badOut) {36 $params_array = array('text' =>$msg); $mid = ''; $appi = new nxsAPI_TW_Native(); $appi->conn = $options; $check = $appi->check(); if ($check===true) { 37 37 if (!empty($options['in_reply_to_id'])) $params_array['in_reply_to_status_id'] = $options['in_reply_to_id']; //## ? 38 38 //## Upload image and add it to the post … … 48 48 //## Fallback in case no mo imgs allowed. 49 49 if ($code == '403' && stripos($resp, 'User is over daily photo limit') !== false && $options['attchImg'] != false && $img != '') { 50 $ badOut['Error'] = $badOut['Error']." User is over daily photo limit. Will post without image\r\n";50 $out['Error'] = $out['Error']." User is over daily photo limit. Will post without image\r\n"; 51 51 $ret = $appi->twReq('https://api.twitter.com/2/tweets', array('text' => $msg)); 52 52 $code = $ret['response']['code']; $resp = $ret['body']; $respJ = json_decode($resp, true); … … 62 62 } else { 63 63 $je = (is_array($respJ) && !empty($respJ['errors']))?"| Error: " . print_r($respJ['errors'], true):''; 64 $ badOut['Error'] = $badOut['Error'] . "| Resp: " . print_r($resp, true) . $je . "| MSG: " . print_r($msg, true);65 return $ badOut;64 $out['Error'] = $out['Error'] . "| Resp: " . print_r($resp, true) . $je . "| MSG: " . print_r($msg, true); 65 return $out; 66 66 } 67 } 68 return $ badOut;67 } else $out['Error'] = $check; 68 return $out; 69 69 } 70 70 -
social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_http.php
r2757212 r2758241 17 17 function request($url, $args = array()){ 18 18 //## Add Proxy to the request. 19 if (empty($this->proxy)&&!empty($args['proxy'])) $this->proxy = $args['proxy']; 19 20 if (!empty($this->proxy)) add_action( "requests-requests.before_request", function( $url, $headers, $data, $type, &$options ){ 20 21 $options['proxy'] = new Requests_Proxy_HTTP( $this->proxy['proxy'] ); 21 22 if ( !empty($this->proxy['up']) ) { $up = explode(':',$this->proxy['up']); 22 23 $options['proxy']->use_authentication = true; 23 $options['proxy']->user = $up[0]; $options['proxy']->pass = $up[1]; 24 $options['proxy']->user = $up[0]; $options['proxy']->pass = $up[1]; //echo "Proxy has been used - ".$this->proxy['proxy']; 24 25 } $options['proxy']->register($options['hooks']); 25 26 }, 10, 5 ); -
social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_ntlist.php
r2757212 r2758241 249 249 if (isset($pval['fltrAfter'])) $o['fltrAfter'] = trim($pval['fltrAfter']); else if (isset($o['fltrAfter'])) unset($o['fltrAfter']); $o['fltrs'] = array(); 250 250 //## Proxy 251 if (isset($pval['proxyOn'])) $o['proxyOn'] = trim($pval['proxyOn']); else $o['proxyOn'] = 0; //prr($o);251 if (isset($pval['proxyOn'])) $o['proxyOn'] = trim($pval['proxyOn']); else $o['proxyOn'] = 0; // prr($o); 252 252 if (isset($pval['proxy'])) $o['proxy']['proxy'] = trim($pval['proxy']); 253 253 if (isset($pval['proxyup'])) $o['proxy']['up'] = trim($pval['proxyup']); -
social-networks-auto-poster-facebook-twitter-g/trunk/readme.txt
r2757419 r2758241 6 6 Requires at least: 3.4 7 7 Tested up to: 6.0.1 8 Stable tag: 4.3.2 88 Stable tag: 4.3.29 9 9 License: GPLv2 or later 10 10 … … 13 13 == Description == 14 14 15 **This plugin automatically publishes posts from your blog to your Social Media accounts** such as Twitter, Google+(Google Plus), Blogger, Tumblr, Flickr, LinkedIn, ok.ru, LiveJournal, DreamWidth, Flipboard, Telegram, Line, Diigo, Instapaper, Pinterest, Plurk, VK.com (VKontakte), YouTube, Scoop.It, Wordpress, XING etc. The whole process is completely automated. Just write a new post and either entire post or it's nicely formatted announcement with backlink will be published to all your configured social networks. You can reach the most audience and tell all your friends, readers and followers about your new post. Plugin works with profiles, business pages, community pages, groups, etc. Messages are 100% customizable and adopted for each network requirements.15 **This plugin automatically publishes posts from your blog to your Social Media accounts** such as Twitter, Blogger, Telegram, Tumblr, Flickr, LinkedIn, ok.ru, LiveJournal, DreamWidth, Flipboard, Google My Business, Line, Diigo, Instapaper, Pinterest, Plurk, VK.com (VKontakte), YouTube, Scoop.It, Wordpress, XING etc. The whole process is completely automated. Just write a new post and either entire post or it's nicely formatted announcement with backlink will be published to all your configured social networks. You can reach the most audience and tell all your friends, readers and followers about your new post. Plugin works with profiles, business pages, community pages, groups, etc. Messages are 100% customizable and adopted for each network requirements. 16 16 17 17 [Great News - July 2022] After almost 2 years break, plugin is back to active development and support. Version 4.4 is coming soon... … … 183 183 == Changelog == 184 184 185 = 4.3.28 [07/15/2022] = 185 = 4.3.29 [07/18/2022] = 186 187 * New/Improvement - [Telegram] - "Image" post type has been added. 188 * New/Improvement - [LJ] - Added support for Proxy. 189 * Bug Fix - Proxy support was broken. 190 * Bug Fix - [Twitter] - fix for "Illegal string offset 'Error'" 191 * Bug Fix - [IG] Fix for "Value must be integer" 192 193 = 4.3.28 [07/16/2022] = 186 194 187 195 * Bug Fix - [ok.ru] - Image upload error fix.
Note: See TracChangeset
for help on using the changeset viewer.