Plugin Directory

Changeset 1280675


Ignore:
Timestamp:
11/05/2015 08:18:32 PM (10 years ago)
Author:
fherryfherry
Message:

update version 2.0.0

Location:
wpostgrabber/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wpostgrabber/trunk/component/wpg_script.js

    r1258786 r1280675  
    7676       
    7777        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           
    7886            var url_position = jQuery("#url_source").offset().top-100;
    7987           
     
    8997            var data = {
    9098                'action':'wpg_grab_content',
     99                'api_key':api_key,
    91100                'url':url
    92101            };
     
    97106                url:wpg_object.ajax_url,
    98107                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);
    101110                        jQuery("#wpg_grab_button").text("Grab URL").prop("disabled",false);
    102111                        jQuery("#url_source").prop("disabled",false);
  • wpostgrabber/trunk/readme.txt

    r1259823 r1280675  
    39391. Wrapper
    4040
    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 :
     45http://www.facebook.com/wpostgrabber/
     46* Homepage :
     47http://websprogramming.com
    4348
    4449== Installation ==
     
    125130* improve grab function
    126131
     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
    127138== Upgrade Notice ==
    128139
     
    170181= 1.1.1 =
    171182* 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  
    11<?php
    2 ini_set('memory_limit','1024M');
    3 set_time_limit(0);
    4 
    52
    63function wpg_test_rss($url) {
     
    4037}
    4138
    42 function wpg_get_content($url) {           
     39function wpg_get_content($url,$apikey) {           
    4340    $array = array();
    4441    $array['domain'] = $_SERVER['SERVER_NAME'];
     
    4643    $array['ip'] = $_SERVER['REMOTE_ADDR'];
    4744    $array['url'] = $url;   
     45    $array['apikey'] = $apikey;
    4846    $data = wpg_posthtml($array,"http://websprogramming.com/wp-plugin/wpostgrabber/api.php");
    4947    return json_decode($data,true);
    5048}
    5149
     50function 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}
     59function 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}
    5264function wpg_posthtml($array,$url) {
    5365     foreach($array as $a => $b) {
  • wpostgrabber/trunk/wpg_settings.php

    r1258786 r1280675  
    11<?php
     2#include(dirname(__FILE__)."/wpg_function.php");
    23
    34function wpg_add_page() {
     
    3839            $set = get_option('wpg_options');
    3940        ?>     
     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       
    4048        <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       
    4156            <tr valign="top">
    4257            <th scope="row">Disallow Word in Title</th>
     
    8095            </td>
    8196            </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>
    82113        </table>
    83114        <p>
     
    111142       
    112143        <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>
    114145       
    115146    </div>
     
    118149
    119150function wpg_validate($input) {
     151       
    120152        $input['data_disallow_title'] =  wp_filter_nohtml_kses($input['data_disallow_title']);
    121153        $input['data_disallow_content'] =  wp_filter_nohtml_kses($input['data_disallow_content']);
     
    123155        $input['url_feed_2'] =  wp_filter_nohtml_kses($input['url_feed_2']);
    124156        $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       
    125165        return $input;
    126166    }
  • wpostgrabber/trunk/wpostgrabber.php

    r1259823 r1280675  
    22/**
    33 * @package WPostGrabber
    4  * @version 1.1.1
     4 * @version 2.0.0
    55 */
    66/*
     
    99Description: WPostGrabber, this plugin will help you to get your content on the website that you want instantly.
    1010Author: Ferry Ariawan
    11 Version: 1.1.1
     11Version: 2.0.0
    1212Author URI: http://websprogramming.com/
    1313*/
     
    4343    global $post;
    4444    global $wpdb;
     45    $set = get_option("wpg_options");
     46   
    4547    if (empty( $post )) $post = get_post($post_id);
    4648           
     
    7072   
    7173    //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    }
    7578    //file_put_contents(WPG_ROOT."/after.txt",$content);   
    7679   
     
    8184        remove_action('add_action','wpg_new_attachment');
    8285    }   
     86   
     87    //Send Statistic
     88    $permalink = get_permalink($post_id);
     89   
     90    wpg_save_permalink($permalink,$set['api_key']);
     91   
    8392}
    8493
     
    105114function wpg_grab_content() {       
    106115    $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']);
    109118        header("Content-type: application/json");
    110119        echo json_encode($data);       
     
    129138add_action( 'wp_ajax_wpg_load_rss', 'wpg_load_rss' );
    130139function wpg_load_rss() {
     140    $set = get_option("wpg_options");
    131141    $post = $_POST;
    132142    if($post['url']) {
     
    148158            ?>     
    149159            <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>             
    152162            </tr>
    153163            <?php
     
    176186    $set = get_option("wpg_options");
    177187?>
     188    <input id='wpg_api_key' type='hidden' value='<?php echo $set['api_key']?>'/>
    178189    <div style="padding:10px;background:#8ccbff;box-shadow:4px 4px 0px #48a1ea">
    179190    <table cellspacing='0'>
    180191        <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>
    183194        </tr>
    184195    </table>
    185196    </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>
    187198
    188199    <?php if($set['url_feed_1'] || $set['url_feed_2'] || $set['url_feed_3']):?>
Note: See TracChangeset for help on using the changeset viewer.