Changeset 1280675
- Timestamp:
- 11/05/2015 08:18:32 PM (10 years ago)
- Location:
- wpostgrabber/trunk
- Files:
-
- 5 edited
-
component/wpg_script.js (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
-
wpg_function.php (modified) (3 diffs)
-
wpg_settings.php (modified) (6 diffs)
-
wpostgrabber.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpostgrabber/trunk/component/wpg_script.js
r1258786 r1280675 76 76 77 77 function wpg_js_grab() { 78 var api_key = jQuery("#wpg_api_key").val(); 79 80 if(api_key=='') { 81 alert("Oops sorry we can't grab without API KEY, please set your API KEY at WPostGrabber Setting's"); 82 return false; 83 } 84 85 78 86 var url_position = jQuery("#url_source").offset().top-100; 79 87 … … 89 97 var data = { 90 98 'action':'wpg_grab_content', 99 'api_key':api_key, 91 100 'url':url 92 101 }; … … 97 106 url:wpg_object.ajax_url, 98 107 success:function(res) { 99 if(res. title=="") {100 alert( "Ops sorry i can`t get any content from that source :(");108 if(res.api_status==0) { 109 alert(res.api_message); 101 110 jQuery("#wpg_grab_button").text("Grab URL").prop("disabled",false); 102 111 jQuery("#url_source").prop("disabled",false); -
wpostgrabber/trunk/readme.txt
r1259823 r1280675 39 39 1. Wrapper 40 40 41 * Fanspage / Community : http://www.facebook.com/wpostgrabber 42 * Homepage : http://websprogramming.com 41 = Agreement Statement = 42 I am willing and agree that I am solely responsible and accepts any risk that may occur upon the use of this plugin. And I agree that I am using this plugin with the "DO WITH YOUR OWN RISKS !" 43 44 * Fanspage / Community : 45 http://www.facebook.com/wpostgrabber/ 46 * Homepage : 47 http://websprogramming.com 43 48 44 49 == Installation == … … 125 130 * improve grab function 126 131 132 = 2.0.0 = 133 * Increase limit grab to 250 times per day 134 * Add API KEY method 135 * Add More URL Feed 136 * Fix bug : blank content when manual / standard posting 137 127 138 == Upgrade Notice == 128 139 … … 170 181 = 1.1.1 = 171 182 * improve grab function 183 184 = 2.0.0 = 185 * Increase limit grab to 250 times per day 186 * Add API KEY method 187 * Add More URL Feed 188 * Fix bug : blank content when manual / standard posting -
wpostgrabber/trunk/wpg_function.php
r1259823 r1280675 1 1 <?php 2 ini_set('memory_limit','1024M');3 set_time_limit(0);4 5 2 6 3 function wpg_test_rss($url) { … … 40 37 } 41 38 42 function wpg_get_content($url ) {39 function wpg_get_content($url,$apikey) { 43 40 $array = array(); 44 41 $array['domain'] = $_SERVER['SERVER_NAME']; … … 46 43 $array['ip'] = $_SERVER['REMOTE_ADDR']; 47 44 $array['url'] = $url; 45 $array['apikey'] = $apikey; 48 46 $data = wpg_posthtml($array,"http://websprogramming.com/wp-plugin/wpostgrabber/api.php"); 49 47 return json_decode($data,true); 50 48 } 51 49 50 function wpg_verify_api($apikey) { 51 $data = file_get_contents("http://websprogramming.com/wp-plugin/wpostgrabber/verifyapi.php?apikey=$apikey"); 52 $data = json_decode($data); 53 if($data->api_status == 0) { 54 return false; 55 }else{ 56 return true; 57 } 58 } 59 function wpg_save_permalink($url,$apikey) { 60 $arr = array(); 61 $arr['url'] = $url; 62 wpg_posthtml($arr,"http://websprogramming.com/wp-plugin/wpostgrabber/save_permalink_published.php?apikey=$apikey"); 63 } 52 64 function wpg_posthtml($array,$url) { 53 65 foreach($array as $a => $b) { -
wpostgrabber/trunk/wpg_settings.php
r1258786 r1280675 1 1 <?php 2 #include(dirname(__FILE__)."/wpg_function.php"); 2 3 3 4 function wpg_add_page() { … … 38 39 $set = get_option('wpg_options'); 39 40 ?> 41 42 <?php if($set['api_key']==''):?> 43 <p> 44 <div class='wpg_alert'>WPostGrabber will not work until you get the <u>VALID API KEY</u>, if you do not have, you can get it for FREE ! <a href='http://goo.gl/L8DofL' target='_blank'>Click Here To Get API KEY</a></div> 45 </p> 46 <?php endif;?> 47 40 48 <table class="form-table"> 49 <tr valign="top"> 50 <th scope="row">API KEY <?php echo ($set['api_key'])?"<img title='Valid API KEY' src='https://cdn2.iconfinder.com/data/icons/free-funktional-icons/16/15_Tick_16x16.png'/>":"<img title='Not Valid API KEY' src='https://cdn1.iconfinder.com/data/icons/nuvola2/16x16/actions/no.png'/>"?></th> 51 <td> 52 <input type='text' required id='api_key' name='wpg_options[api_key]' size='90' placeholder='Enter your api key' value='<?php echo $set['api_key']?>'/> 53 </td> 54 </tr> 55 41 56 <tr valign="top"> 42 57 <th scope="row">Disallow Word in Title</th> … … 80 95 </td> 81 96 </tr> 97 98 <tr valign="top"> 99 <th scope="row">URL Feed 4</th> 100 <td> 101 <input type='text' id='wpg_url_feed_4' name='wpg_options[url_feed_4]' size='90' placeholder='http://...' value='<?php echo $set['url_feed_4']?>'/> 102 <input type='button' title='Click me to test wheter support or not' onclick='wpg_test_url(this,"wpg_url_feed_4")' class='button button-primary' value='Test'/> 103 </td> 104 </tr> 105 106 <tr valign="top"> 107 <th scope="row">URL Feed 5</th> 108 <td> 109 <input type='text' id='wpg_url_feed_3' name='wpg_options[url_feed_5]' size='90' placeholder='http://...' value='<?php echo $set['url_feed_5']?>'/> 110 <input type='button' title='Click me to test wheter support or not' onclick='wpg_test_url(this,"wpg_url_feed_5")' class='button button-primary' value='Test'/> 111 </td> 112 </tr> 82 113 </table> 83 114 <p> … … 111 142 112 143 <br/><br/> 113 <p>Visit : <a target='_blank' href='http:// websprogramming.com/'>Our Homepage</a></p>144 <p>Visit : <a target='_blank' href='http://jasabuatweboke.com?ref=WPostGrabber-Setting-Page'>Our Homepage</a></p> 114 145 115 146 </div> … … 118 149 119 150 function wpg_validate($input) { 151 120 152 $input['data_disallow_title'] = wp_filter_nohtml_kses($input['data_disallow_title']); 121 153 $input['data_disallow_content'] = wp_filter_nohtml_kses($input['data_disallow_content']); … … 123 155 $input['url_feed_2'] = wp_filter_nohtml_kses($input['url_feed_2']); 124 156 $input['url_feed_3'] = wp_filter_nohtml_kses($input['url_feed_3']); 157 $input['url_feed_4'] = wp_filter_nohtml_kses($input['url_feed_4']); 158 $input['url_feed_5'] = wp_filter_nohtml_kses($input['url_feed_5']); 159 $input['api_key'] = wp_filter_nohtml_kses($input['api_key']); 160 161 if(wpg_verify_api($input['api_key']) == FALSE) { 162 $input['api_key'] = ''; 163 } 164 125 165 return $input; 126 166 } -
wpostgrabber/trunk/wpostgrabber.php
r1259823 r1280675 2 2 /** 3 3 * @package WPostGrabber 4 * @version 1.1.14 * @version 2.0.0 5 5 */ 6 6 /* … … 9 9 Description: WPostGrabber, this plugin will help you to get your content on the website that you want instantly. 10 10 Author: Ferry Ariawan 11 Version: 1.1.111 Version: 2.0.0 12 12 Author URI: http://websprogramming.com/ 13 13 */ … … 43 43 global $post; 44 44 global $wpdb; 45 $set = get_option("wpg_options"); 46 45 47 if (empty( $post )) $post = get_post($post_id); 46 48 … … 70 72 71 73 //Update post_content 72 $where = array( 'ID' => $post_id ); 73 $wpdb->update( $wpdb->posts, array( 'post_content' => $content ), $where ); 74 74 if($last_image) { 75 $where = array( 'ID' => $post_id ); 76 $wpdb->update( $wpdb->posts, array( 'post_content' => $content ), $where ); 77 } 75 78 //file_put_contents(WPG_ROOT."/after.txt",$content); 76 79 … … 81 84 remove_action('add_action','wpg_new_attachment'); 82 85 } 86 87 //Send Statistic 88 $permalink = get_permalink($post_id); 89 90 wpg_save_permalink($permalink,$set['api_key']); 91 83 92 } 84 93 … … 105 114 function wpg_grab_content() { 106 115 $post = $_POST; 107 if($post['url'] ) {108 $data = wpg_get_content($post['url'] );116 if($post['url'] && $post['api_key']) { 117 $data = wpg_get_content($post['url'],$post['api_key']); 109 118 header("Content-type: application/json"); 110 119 echo json_encode($data); … … 129 138 add_action( 'wp_ajax_wpg_load_rss', 'wpg_load_rss' ); 130 139 function wpg_load_rss() { 140 $set = get_option("wpg_options"); 131 141 $post = $_POST; 132 142 if($post['url']) { … … 148 158 ?> 149 159 <tr> 150 <td colspan="2"><?php echo $no;?>. <a href="javascript:;" onClick=" wpg_trigger_grab('<?php echo $r['link']?>')"><?php echo $r['title']?></a></td>151 <td align="center"><a class='button button-primary' href='javascript:;' onClick="wpg_trigger_grab('<?php echo $r['link']?>')">Grab</a></td>160 <td colspan="2"><?php echo $no;?>. <a href="javascript:;" onClick="<?php if($set['api_key']!=''):?>wpg_trigger_grab('<?php echo $r['link']?>')<?php endif;?>"><?php echo $r['title']?></a></td> 161 <td align="center"><a class='button button-primary' href='javascript:;' <?php echo ($set['api_key']=='')?"disabled":""?> onClick="<?php if($set['api_key']!=''):?>wpg_trigger_grab('<?php echo $r['link']?>')<?php endif;?>">Grab</a></td> 152 162 </tr> 153 163 <?php … … 176 186 $set = get_option("wpg_options"); 177 187 ?> 188 <input id='wpg_api_key' type='hidden' value='<?php echo $set['api_key']?>'/> 178 189 <div style="padding:10px;background:#8ccbff;box-shadow:4px 4px 0px #48a1ea"> 179 190 <table cellspacing='0'> 180 191 <tr> 181 <td><input type='text' style='width:100%' id='url_source' placeholder='Input URL here..'/></td>182 <td width='5%'><button class='button button-primary' style='cursor:pointer' id='wpg_grab_button' onClick='wpg_js_grab()' type='button'>Grab Now :P</button></td>192 <td><input type='text' style='width:100%' id='url_source' <?php echo ($set['api_key']=='')?"disabled":""?> placeholder='<?php echo ($set['api_key']=='')?"Please Enter Your API KEY first, go to WPostGrabber Setting's":""?>'/></td> 193 <td width='5%'><button class='button button-primary' style='cursor:pointer' id='wpg_grab_button' <?php echo ($set['api_key']=='')?"disabled":""?> onClick='wpg_js_grab()' type='button'>Grab Now</button></td> 183 194 </tr> 184 195 </table> 185 196 </div> 186 <p class='howto'>Example url <span style='cursor:pointer' class='wpg_example_link' title='http://www.usatoday.com/story/tech/2015/09/12/most-incredible-discoveries-week-newser/72141778/'>Click Here</span></p>197 <p class='howto'>Example URL Usually : http://www.example.com/article-name/ , please enter only url with content not url homepage or url rss</p> 187 198 188 199 <?php if($set['url_feed_1'] || $set['url_feed_2'] || $set['url_feed_3']):?>
Note: See TracChangeset
for help on using the changeset viewer.