Plugin Directory

Changeset 327455


Ignore:
Timestamp:
12/31/2010 05:00:02 AM (15 years ago)
Author:
neop
Message:

Updating to version 3.0

Location:
postalicious
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • postalicious/tags/3.0/readme.txt

    r325794 r327455  
    22Contributors: neop
    33Donate link: http://neop.gbtopia.com/?p=108
    4 Tags: bookmarks, delicious, ma.gnolia, Google Reader, Reddit, Yahoo Pipes
     4Tags: bookmarks, delicious, pinboard, diigo, Google Reader, Reddit, Yahoo Pipes, Jumptags
    55Requires at least: 2.3
    6 Tested up to: 3.0.1
    7 Stable tag: 2.9.3
    8 
    9 Postalicious is a WordPress plugin that automatically posts your delicious, ma.gnolia, Google Reader, Reddit, Yahoo Pipes, or Jumptags bookmarks to your blog.
     6Tested up to: 3.0.4
     7Stable tag: 3.0
     8
     9Postalicious is a WordPress plugin that automatically posts your delicious, Google Reader, Reddit, Yahoo Pipes, Jumptags, Pinboard, or Diigo bookmarks to your blog.
    1010
    1111== Description ==
    1212
    13 Postalicious is a WordPress plugin that automatically posts your delicious, ma.gnolia, Google Reader, Reddit or Yahoo Pipes bookmarks to your blog. The exact details of how your bookmarks are posted are very customizable and are designed to meet your specific needs. Postalicious uses the psuedo-cron functionality introduced in WordPress 2.1 to schedule automatic hourly updates. If you do not have WordPress 2.1 or later installed, you will still be able to use Postalicious, but you will have to perform the updates manually.
     13Postalicious is a WordPress plugin that automatically posts your delicious, Google Reader, Reddit, Yahoo Pipes, Jumptags, Pinboard, or Diigo bookmarks to your blog. The exact details of how your bookmarks are posted are very customizable and are designed to meet your specific needs. Postalicious uses the psuedo-cron functionality introduced in WordPress 2.1 to schedule automatic hourly updates. If you do not have WordPress 2.1 or later installed, you will still be able to use Postalicious, but you will have to perform the updates manually.
    1414
    1515== Installation ==
    1616
    17 Simply copy "wp-postalicious.php" to the "wp-content/plugins/" folder found in your WordPress installation. Then go to the "Plugins" tab inside the WordPress administration website and activate Postalicious. Finally you need to enter your account type (delicious, ma.gnolia, Google Reader, Reddit or Yahoo Pipes) and details as well as other Postalicious preferences in the by clicking the link labeled "Postalicious" inside the "Settings" menu on the navigation bar in the WordPress administration website.
     17Simply copy "wp-postalicious.php" to the "wp-content/plugins/" folder found in your WordPress installation. Then go to the "Plugins" tab inside the WordPress administration website and activate Postalicious. Finally you need to enter your account type (delicious, Google Reader, Reddit, Yahoo Pipes, Jumptags, Pinboard, or Diigo) and details as well as other Postalicious preferences in the by clicking the link labeled "Postalicious" inside the "Settings" menu on the navigation bar in the WordPress administration website.
    1818
    1919== Frequently Asked Questions ==
     
    5353= Why are tag-related features disabled? =
    5454
    55 Reddit and Yahoo Pipes do not support tags. Google Reader does support tags, but those tags are not available in the RSS feed, therefore POstalicious can't fetch them.
     55Not all services support tags, other services do support tags but don't make them available on the RSS feed. In each case I've tried to support tags whenever possible.
    5656
    5757== Usage ==
     
    6262
    6363* Automatically create posts in your blog with your bookmarks that allow you to keep your blog updated just by bookmarking your favorite websites!
    64 * Works with delicious, ma.gnolia, Google Reader, Reddit and Yahoo Pipes.
     64* Works with delicious, Google Reader, Reddit, Yahoo Pipes, Jumptags, Pinboard, and Diigo.
    6565* Complete control over how often your bookmarks are posted and how many bookmarks should appear on each post.
    6666* If the post is not ready for prime time, Postalicious creates a draft with the pending bookmarks which you can publish any time or wait for Postalicious to publish it when it meets your publishing settings.
     
    7272== Changelog ==
    7373
     74= Version 3.0 =
     75
     76* Removed gnolia support.
     77* Added support for Pinboard and Diigo.
     78* Added a button to reset all settings.
     79* Cleanup and minor bug fixes.
     80
    7481= Version 2.9.3 =
    7582
    76 * Add `%author_name%` and `%source_link%` template variables (in Delicious.com service only).
    77 * Minor formatting improvements on settings page.
     83* Add `%author_name%` and `%source_link%` template variables (in Delicious.com service only). (Thanks Meitar!)
     84* Minor formatting improvements on settings page. (Thanks Meitar!)
    7885
    7986= Version 2.9.2 =
  • postalicious/tags/3.0/wp-postalicious.php

    r325794 r327455  
    44Plugin URI: http://neop.gbtopia.com/?p=108
    55Description: Automatically create posts with your delicious bookmarks.
    6 Version: 2.9.3
     6Version: 3.0
    77Author: Pablo Gomez
    88Author URI: http://neop.gbtopia.com
     
    1010
    1111if (!defined('POSTALICIOUS_UA_STRING')) {
    12     define('POSTALICIOUS_UA_STRING', 'Postalicious 2.9');
     12    define('POSTALICIOUS_UA_STRING', 'Postalicious 3.0');
    1313}
    1414
     
    2424        exit(0); // Only AJAX requests should get here so there's no reason to continue executing.
    2525    }
    26 
    2726
    2827    if(!class_exists('SimplePie')) {
     
    187186        $message .= neop_pstlcs_post_new(0);
    188187    }
     188   
     189    if(isset($_POST['nd_resetsettings'])) {
     190        // Reset all the settings.
     191        delete_option('nd_log');
     192        delete_option('nd_logcount');
     193        delete_option('nd_service');
     194        delete_option('nd_username');
     195        delete_option('nd_idforposts');
     196        delete_option('nd_catforposts');
     197        delete_option('nd_allowcomments');
     198        delete_option('nd_allowpings');
     199        delete_option('nd_mincount');
     200        delete_option('nd_maxcount');
     201        delete_option('nd_maxhours');
     202        delete_option('nd_post_time');
     203        delete_option('nd_post_hour');
     204        delete_option('nd_post_minutes');
     205        delete_option('nd_post_meridian');
     206        delete_option('nd_publishmissed');
     207        delete_option('nd_poststatus');
     208        delete_option('nd_publishbehaviour');
     209        delete_option('nd_htmltags');
     210        delete_option('nd_whitelist');
     211        delete_option('nd_blacklist');
     212        delete_option('nd_datetemplate');
     213        delete_option('nd_slugtemplate');
     214        delete_option('nd_titlesingle');
     215        delete_option('nd_titledouble');
     216        delete_option('nd_linktemplate');
     217        delete_option('nd_tagtemplate');
     218        delete_option('nd_posttsingle');
     219        delete_option('nd_posttdouble');
     220        delete_option('nd_excerptsingle');
     221        delete_option('nd_excerptdouble');
     222        delete_option('nd_use_post_tags');
     223        delete_option('nd_post_tags');
     224        delete_option('nd_hourlyupdates');
     225        delete_option('nd_tagging_enabled');
     226        delete_option('nd_use_del_tags');
     227        delete_option('nd_utw_enabled');
     228        delete_option('nd_draftdate2');
     229        delete_option('nd_version');
     230        delete_option('nd_lastrun');
     231        delete_option('nd_updating');
     232        delete_option('nd_failedcount');
     233        delete_option('nd_lastupdate');
     234        delete_option('nd_lastpostdate');
     235        delete_option('nd_queue_count');
     236        delete_option('nd_queue_time');
     237        delete_option('nd_trackedposts');
     238        delete_option('nd_draftcontent');
     239        delete_option('nd_unpublishedcount');
     240        delete_option('nd_draftdate');
     241        delete_option('nd_drafttags');
     242        delete_option('nd_lastdraftid');
     243        delete_option('nd_draft_time');
     244        $message = 'The settings were reset successfully.';
     245    }
     246   
    189247    if($message != '') { ?>
    190248        <div id="message" class="updated fade"><p style="line-height:150%"><strong>
     
    251309    // [SERVICE]
    252310    $tagsdisabled = 0;
    253     if($nd_service == 2 || $nd_service == 4 || $nd_service == 5) $tagsdisabled = 1;
    254     $urlservice = 1;
    255     if($nd_service == 1 || $nd_service == 6) $urlservice = 0;
     311    if($nd_service == 2 || $nd_service == 4 || $nd_service == 5 || $nd_service == 8) $tagsdisabled = 1;
    256312
    257313?>
     
    264320        oldservice = nd_service_js;
    265321        if(document.getElementById('nd_service_0').checked) nd_service_js = 0;
    266         else if(document.getElementById('nd_service_1').checked) nd_service_js = 1;
    267322        else if(document.getElementById('nd_service_2').checked) nd_service_js = 2;
    268323        else if(document.getElementById('nd_service_4').checked) nd_service_js = 4;
    269324        else if(document.getElementById('nd_service_5').checked) nd_service_js = 5;
    270325        else if(document.getElementById('nd_service_6').checked) nd_service_js = 6;
     326        else if(document.getElementById('nd_service_7').checked) nd_service_js = 7;
     327        else if(document.getElementById('nd_service_8').checked) nd_service_js = 8;
    271328
    272329        if(oldservice != nd_service_js) document.nd_settingsform.nd_settingschanged.value = "1";
     
    275332            switch(type) {
    276333                case 'tags' :
    277                     if(service == 2 || service == 4 || service == 5) return 1;
     334                    if(service == 2 || service == 4 || service == 5 || service == 8) return 1;
    278335                    else return 0;
    279                     break;
    280                 case 'url' :
    281                     if(service == 1 || service == 6) return 0;
    282                     else return 1;
    283336                    break;
    284337            }
     
    301354                document.getElementById('nd_whitelist_row').style.visibility = 'visible';
    302355                document.getElementById('nd_blacklist_row').style.visibility = 'visible';
    303             }
    304         }
    305 
    306         old_urlservice = nd_status('url',oldservice);
    307         new_urlservice = nd_status('url',nd_service_js);
    308 
    309         if(old_urlservice != new_urlservice) {
    310             if(new_urlservice == 1) {
    311                 document.getElementById('th_username').innerHTML = "Feed URL";
    312                 document.getElementById('nd_username').size = "50";
    313             } else {
    314                 document.getElementById('th_username').innerHTML = "Username";
    315                 document.getElementById('nd_username').size = "15";
    316356            }
    317357        }
     
    417457        <label><input id="nd_service_0" name="nd_service" type="radio" value="0" <?php if($nd_service == 0) echo 'checked="checked"' ?> onclick="nd_servicechanged();" />
    418458        delicious</label><br />
    419         <label><input id="nd_service_1" name="nd_service" type="radio" value="1" <?php if($nd_service == 1) echo 'checked="checked"' ?> onclick="nd_servicechanged();" />
    420         ma.gnolia</label><br />
    421459        <label><input id="nd_service_2" name="nd_service" type="radio" value="2" <?php if($nd_service == 2) echo 'checked="checked"' ?> onclick="nd_servicechanged();" />
    422460        Google Reader</label><br />
     
    426464        Yahoo Pipes</label><br />
    427465        <label><input id="nd_service_6" name="nd_service" type="radio" value="6" <?php if($nd_service == 6) echo 'checked="checked"' ?> onclick="nd_servicechanged();" />
    428         Jumptags</label>
     466        Jumptags</label><br />
     467        <label><input id="nd_service_7" name="nd_service" type="radio" value="7" <?php if($nd_service == 7) echo 'checked="checked"' ?> onclick="nd_servicechanged();" />
     468        Pinboard</label><br />
     469        <label><input id="nd_service_8" name="nd_service" type="radio" value="8" <?php if($nd_service == 8) echo 'checked="checked"' ?> onclick="nd_servicechanged();" />
     470        Diigo</label>
    429471        </fieldset></td>
    430472        </tr>
    431473        <tr valign="top">
    432         <th id="th_username"><label for="nd_username"><?php if($urlservice) echo "Feed URL"; else echo "Username"?></label></th>
     474        <th id="th_username"><label for="nd_username">Feed URL</label></th>
    433475        <td colspan="2">
    434         <input name="nd_username" type="text" id="nd_username" value="<?php echo $nd_username; ?>" size="<?php if($urlservice) echo "50"; else echo "15";?>" onchange="this.form.nd_settingschanged.value=1" />
     476        <input name="nd_username" type="text" id="nd_username" value="<?php echo $nd_username; ?>" size="50" onchange="this.form.nd_settingschanged.value=1" />
    435477        </td></tr>
    436478        </table>
     
    640682        <textarea readonly="readonly" name="nd_log" id="nd_log" style="width: 98%;" rows="20" cols="50"><?php echo $nd_log; ?></textarea>
    641683        <input type="button" class="button-secondary" value="Clear Log" onclick="nd_clearthelog()" /><span id="nd_clogspan" style="margin-left:5px;"></span>
     684        <br /><br /><input type="submit" name="nd_resetsettings" class="button-secondary" value="Reset All Settings" onclick="return confirm('Are you sure you want to reset all settings?')" />
    642685        <div class="submit"><input type="submit" name="save_changes" class="button-primary" value="Save Changes" onclick="nd_submitbutton = 0" /></div>
    643686        </form>
     
    692735    switch ($x) {
    693736        case 0: return 'delicious';
    694         case 1: return 'ma.gnolia';
    695737        case 2: return 'Google Reader';
    696         case 3: return 'Reddit';
    697         case 4: return 'Yahoo Pipes';
    698         case 5: return 'Jumptags';
     738        case 3: return 'Google Bookmarks';
     739        case 4: return 'Reddit';
     740        case 5: return 'Yahoo Pipes';
     741        case 6: return 'Jumptags';
     742        case 7: return 'Pinboard';
     743        case 8: return 'Diigo';
    699744    }
    700745}
    701746endif;
    702747
    703 /**
    704  * Simple service info to feed URL mapping function.
    705  *
    706  * @param $srv_id int The internal service ID number.
    707  * @param $user string The username component of the URL, or the feed itself (depending on service).
    708  * @return string The correct URL from which to obtain the feed.
    709  */
    710 if (!function_exists('neop_pstlcs_get_service_url_by_id')) :
    711 function neop_pstlcs_get_service_url_by_id($srv_id, $user) {
    712     switch($srv_id) {
    713         case 0 : return $user; // delicious
    714         case 1 : return 'http://ma.gnolia.com/rss/lite/people/'.urlencode($user); // ma.gnolia
    715         case 2 : return $user; // Google Reader
    716         case 3 : return $user; // Google Bookmarks
    717         case 4 : return $user; // Reddit
    718         case 5 : return $user; // Yahoo Pipes
    719         case 6 : return 'http://www.jumptags.com/'.urlencode($user).'?rss=xml'; // Jumptags
    720     }
    721 }
    722 endif;
    723 
    724748if (!function_exists('neop_pstlcs_update')) :
    725749function neop_pstlcs_update() {
    726     if(!($nd_version = get_option('nd_version'))) $nd_version = 280; // Because of a bug in 121, get_option('nd_version') will always be at least 150
     750    if(!($nd_version = get_option('nd_version'))) $nd_version = 300; // Because of a bug in 121, get_option('nd_version') will always be at least 150
    727751    if($nd_version < 121) {
    728752        if(get_option('nd_utw_enabled') == 'yes') {
     
    837861        $nd_version = 280;
    838862    }
     863    if($nd_version < 300) {
     864        // All services are now url services, so change usernames into urls.
     865        $service = get_option('nd_service');       
     866        if($service == 1) update_option('nd_username','http://ma.gnolia.com/rss/lite/people/'.urlencode(get_option('nd_username')));
     867        else if($service == 6) update_option('nd_username','http://www.jumptags.com/'.urlencode(get_option('nd_username')).'?rss=xml');
     868        $nd_version = 300;
     869    }
    839870    update_option('nd_version',$nd_version);
    840871}
     
    870901    $username = get_option('nd_username');
    871902
    872     if($username) { // [SERVICE]
    873         $rssurl = neop_pstlcs_get_service_url_by_id($service, $username);
     903    if($username) {
     904        $rssurl = $username;
    874905    }
    875906    else {
     
    9791010
    9801011            switch($service) { // [SERVICE] Some services need certain tags to be allowed.
    981                 case 1 : $nd_htmltags .= 'p,strong,a,img'; break; // ma.gnolia
    9821012                case 2 : $nd_htmltags .= 'br'; break; // Google Reader
    9831013                case 4 : $nd_htmltags = 'a,br'; break; // Reddit (the user's allowed tags don't matter)
     1014                case 8 : $nd_htmltags .= 'a,p,strong'; break; // Diigo
    9841015            }
    9851016
     
    10041035                switch($service) { // [SERVICE]
    10051036                    case 0: // delicious
    1006                         $bookmark['title'] = $item->get_title();
    1007                         $bookmark['link'] = $item->get_link();
    1008                         $bookmark['description'] = $item->get_description();
    1009                         $bookmark['date'] = $item->get_date('Y-m-d H:i:s T');
    1010                         if (NULL !== $item_author) {
    1011                             $bookmark['author_name'] = $item_author->get_name();
    1012                             $bookmark['author_link'] = $item_author->get_link();
    1013                         }
    1014                         $bookmark['source_link'] = $item->get_id();
    1015 
    1016                         $arr = $item->get_item_tags('', 'category');
    1017                         $bookmark['tags'] = '';
    1018                         if($arr) foreach($arr as $arritm) $bookmark['tags'] .= ",{$arritm['data']}";
    1019                         $bookmark['tags'] = ltrim($bookmark['tags'],",");
    1020                         break;
    1021                     case 1: // ma.gnolia
    10221037                        $bookmark['title'] = $item->get_title();
    10231038                        $bookmark['link'] = $item->get_link();
     
    10891104                        if($arr) foreach($arr as $arritm) $bookmark['tags'] .= ",{$arritm['data']}";
    10901105                        $bookmark['tags'] = ltrim($bookmark['tags'],",");
     1106                        break;
     1107                    case 7: // Pinboard
     1108                        $bookmark['title'] = $item->get_title();
     1109                        $bookmark['link'] = $item->get_link();
     1110                        $bookmark['description'] = $item->get_description();
     1111                        $bookmark['date'] = $item->get_date('Y-m-d H:i:s T');
     1112                        if (NULL !== $item_author) {
     1113                            $bookmark['author_name'] = $item_author->get_name();
     1114                            $bookmark['author_link'] = $item_author->get_link();
     1115                        }
     1116                        $bookmark['source_link'] = $item->get_id();
     1117                       
     1118                        $bookmark['tags'] = str_replace(' ',',',neop_pstlcs_arrelm($item->get_item_tags('http://purl.org/dc/elements/1.1/','subject'),0,'data'));                       
     1119                        break;
     1120                    case 8 : // Diigo
     1121                         $bookmark['title'] = $item->get_title();
     1122                        $bookmark['link'] = $item->get_link();
     1123                        $bookmark['description'] = $item->get_description();
     1124                        $bookmark['date'] = $item->get_date('Y-m-d H:i:s T');
     1125                        if (NULL !== $item_author) {
     1126                            $bookmark['author_name'] = $item_author->get_name();
     1127                            $bookmark['author_link'] = $item_author->get_link();
     1128                        }
     1129                        $bookmark['source_link'] = $item->get_id();
     1130
     1131                        $bookmark['tags'] = '';                     
     1132                        break;
    10911133                }
    10921134
     
    11721214                        switch($service) { // [SERVICE]
    11731215                            case 0 : //delicious
    1174                                 $tagUsername = preg_replace('/http:\/\/feeds.delicious.com\/v2\/rss\/([^\/]*).*/','$1',$username);
     1216                                $tagUsername = preg_replace('/http:\/\/feeds.delicious.com\/v2\/rss\/([^?\/]*).*/','$1',$username);
    11751217                                if($tagUsername == $username) $nd_site_tagurl = 'http://www.delicious.com/tag/'; // $username is an unrecognized url.
    1176                                 else  $nd_site_tagurl = "http://delicious.com/{$tagUsername}/";
     1218                                else  $nd_site_tagurl = "http://www.delicious.com/{$tagUsername}/";
    11771219                                break;
    1178                             case 1 : $nd_site_tagurl = "http://ma.gnolia.com/people/{$username}/tags/"; break; // ma.gnolia
    11791220                            case 2 : $nd_site_tagurl = '#'; break; // Google Reader (we should never get here)
    11801221                            case 3 : $nd_site_tagurl = '#'; break; // Google Bookmarks does not have a public tag url.
    11811222                            case 4 : $nd_site_tagurl = '#'; break; // Reddit (we should never get here)
    11821223                            case 5 : $nd_site_tagurl = '#'; break; // Yahoo pipes (we should never get here)
    1183                             case 6 : $nd_site_tagurl = "http://www.jumptags.com/{$username}/"; break; // Jumptags
     1224                            case 6 : // Jumptags
     1225                                $tagUsername = preg_replace('/http:\/\/www.jumptags.com\/([^?]*).*?rss=xml/','$1',$username);
     1226                                if($tagUsername == $username) $nd_site_tagurl = 'http://www.jumptags.com/topic/'; // $username is an unrecognized url.
     1227                                else  $nd_site_tagurl = "http://www.jumptags.com/{$tagUsername}/";
     1228                                break;
     1229                            case 7 : // Pinboard
     1230                                $tagUsername = preg_replace('/http:\/\/feeds.pinboard.in\/rss\/secret:[^\/]*\/u:([^\/]*).*/','$1',$username);
     1231                                if($tagUsername == $username) $nd_site_tagurl = 'http://pinboard.in/t:'; // $username is an unrecognized url.
     1232                                else  $nd_site_tagurl = "http://pinboard.in/u:{$tagUsername}/t:";
     1233                                break;
     1234                            case 8 : $nd_site_tagurl = '#'; break; // Diigo (we should never get here)
    11841235                        }
    11851236                        $tags = explode(',',$bookmark['tags']);
  • postalicious/trunk/readme.txt

    r325794 r327455  
    22Contributors: neop
    33Donate link: http://neop.gbtopia.com/?p=108
    4 Tags: bookmarks, delicious, ma.gnolia, Google Reader, Reddit, Yahoo Pipes
     4Tags: bookmarks, delicious, pinboard, diigo, Google Reader, Reddit, Yahoo Pipes, Jumptags
    55Requires at least: 2.3
    6 Tested up to: 3.0.1
    7 Stable tag: 2.9.3
    8 
    9 Postalicious is a WordPress plugin that automatically posts your delicious, ma.gnolia, Google Reader, Reddit, Yahoo Pipes, or Jumptags bookmarks to your blog.
     6Tested up to: 3.0.4
     7Stable tag: 3.0
     8
     9Postalicious is a WordPress plugin that automatically posts your delicious, Google Reader, Reddit, Yahoo Pipes, Jumptags, Pinboard, or Diigo bookmarks to your blog.
    1010
    1111== Description ==
    1212
    13 Postalicious is a WordPress plugin that automatically posts your delicious, ma.gnolia, Google Reader, Reddit or Yahoo Pipes bookmarks to your blog. The exact details of how your bookmarks are posted are very customizable and are designed to meet your specific needs. Postalicious uses the psuedo-cron functionality introduced in WordPress 2.1 to schedule automatic hourly updates. If you do not have WordPress 2.1 or later installed, you will still be able to use Postalicious, but you will have to perform the updates manually.
     13Postalicious is a WordPress plugin that automatically posts your delicious, Google Reader, Reddit, Yahoo Pipes, Jumptags, Pinboard, or Diigo bookmarks to your blog. The exact details of how your bookmarks are posted are very customizable and are designed to meet your specific needs. Postalicious uses the psuedo-cron functionality introduced in WordPress 2.1 to schedule automatic hourly updates. If you do not have WordPress 2.1 or later installed, you will still be able to use Postalicious, but you will have to perform the updates manually.
    1414
    1515== Installation ==
    1616
    17 Simply copy "wp-postalicious.php" to the "wp-content/plugins/" folder found in your WordPress installation. Then go to the "Plugins" tab inside the WordPress administration website and activate Postalicious. Finally you need to enter your account type (delicious, ma.gnolia, Google Reader, Reddit or Yahoo Pipes) and details as well as other Postalicious preferences in the by clicking the link labeled "Postalicious" inside the "Settings" menu on the navigation bar in the WordPress administration website.
     17Simply copy "wp-postalicious.php" to the "wp-content/plugins/" folder found in your WordPress installation. Then go to the "Plugins" tab inside the WordPress administration website and activate Postalicious. Finally you need to enter your account type (delicious, Google Reader, Reddit, Yahoo Pipes, Jumptags, Pinboard, or Diigo) and details as well as other Postalicious preferences in the by clicking the link labeled "Postalicious" inside the "Settings" menu on the navigation bar in the WordPress administration website.
    1818
    1919== Frequently Asked Questions ==
     
    5353= Why are tag-related features disabled? =
    5454
    55 Reddit and Yahoo Pipes do not support tags. Google Reader does support tags, but those tags are not available in the RSS feed, therefore POstalicious can't fetch them.
     55Not all services support tags, other services do support tags but don't make them available on the RSS feed. In each case I've tried to support tags whenever possible.
    5656
    5757== Usage ==
     
    6262
    6363* Automatically create posts in your blog with your bookmarks that allow you to keep your blog updated just by bookmarking your favorite websites!
    64 * Works with delicious, ma.gnolia, Google Reader, Reddit and Yahoo Pipes.
     64* Works with delicious, Google Reader, Reddit, Yahoo Pipes, Jumptags, Pinboard, and Diigo.
    6565* Complete control over how often your bookmarks are posted and how many bookmarks should appear on each post.
    6666* If the post is not ready for prime time, Postalicious creates a draft with the pending bookmarks which you can publish any time or wait for Postalicious to publish it when it meets your publishing settings.
     
    7272== Changelog ==
    7373
     74= Version 3.0 =
     75
     76* Removed gnolia support.
     77* Added support for Pinboard and Diigo.
     78* Added a button to reset all settings.
     79* Cleanup and minor bug fixes.
     80
    7481= Version 2.9.3 =
    7582
    76 * Add `%author_name%` and `%source_link%` template variables (in Delicious.com service only).
    77 * Minor formatting improvements on settings page.
     83* Add `%author_name%` and `%source_link%` template variables (in Delicious.com service only). (Thanks Meitar!)
     84* Minor formatting improvements on settings page. (Thanks Meitar!)
    7885
    7986= Version 2.9.2 =
  • postalicious/trunk/wp-postalicious.php

    r325794 r327455  
    44Plugin URI: http://neop.gbtopia.com/?p=108
    55Description: Automatically create posts with your delicious bookmarks.
    6 Version: 2.9.3
     6Version: 3.0
    77Author: Pablo Gomez
    88Author URI: http://neop.gbtopia.com
     
    1010
    1111if (!defined('POSTALICIOUS_UA_STRING')) {
    12     define('POSTALICIOUS_UA_STRING', 'Postalicious 2.9');
     12    define('POSTALICIOUS_UA_STRING', 'Postalicious 3.0');
    1313}
    1414
     
    2424        exit(0); // Only AJAX requests should get here so there's no reason to continue executing.
    2525    }
    26 
    2726
    2827    if(!class_exists('SimplePie')) {
     
    187186        $message .= neop_pstlcs_post_new(0);
    188187    }
     188   
     189    if(isset($_POST['nd_resetsettings'])) {
     190        // Reset all the settings.
     191        delete_option('nd_log');
     192        delete_option('nd_logcount');
     193        delete_option('nd_service');
     194        delete_option('nd_username');
     195        delete_option('nd_idforposts');
     196        delete_option('nd_catforposts');
     197        delete_option('nd_allowcomments');
     198        delete_option('nd_allowpings');
     199        delete_option('nd_mincount');
     200        delete_option('nd_maxcount');
     201        delete_option('nd_maxhours');
     202        delete_option('nd_post_time');
     203        delete_option('nd_post_hour');
     204        delete_option('nd_post_minutes');
     205        delete_option('nd_post_meridian');
     206        delete_option('nd_publishmissed');
     207        delete_option('nd_poststatus');
     208        delete_option('nd_publishbehaviour');
     209        delete_option('nd_htmltags');
     210        delete_option('nd_whitelist');
     211        delete_option('nd_blacklist');
     212        delete_option('nd_datetemplate');
     213        delete_option('nd_slugtemplate');
     214        delete_option('nd_titlesingle');
     215        delete_option('nd_titledouble');
     216        delete_option('nd_linktemplate');
     217        delete_option('nd_tagtemplate');
     218        delete_option('nd_posttsingle');
     219        delete_option('nd_posttdouble');
     220        delete_option('nd_excerptsingle');
     221        delete_option('nd_excerptdouble');
     222        delete_option('nd_use_post_tags');
     223        delete_option('nd_post_tags');
     224        delete_option('nd_hourlyupdates');
     225        delete_option('nd_tagging_enabled');
     226        delete_option('nd_use_del_tags');
     227        delete_option('nd_utw_enabled');
     228        delete_option('nd_draftdate2');
     229        delete_option('nd_version');
     230        delete_option('nd_lastrun');
     231        delete_option('nd_updating');
     232        delete_option('nd_failedcount');
     233        delete_option('nd_lastupdate');
     234        delete_option('nd_lastpostdate');
     235        delete_option('nd_queue_count');
     236        delete_option('nd_queue_time');
     237        delete_option('nd_trackedposts');
     238        delete_option('nd_draftcontent');
     239        delete_option('nd_unpublishedcount');
     240        delete_option('nd_draftdate');
     241        delete_option('nd_drafttags');
     242        delete_option('nd_lastdraftid');
     243        delete_option('nd_draft_time');
     244        $message = 'The settings were reset successfully.';
     245    }
     246   
    189247    if($message != '') { ?>
    190248        <div id="message" class="updated fade"><p style="line-height:150%"><strong>
     
    251309    // [SERVICE]
    252310    $tagsdisabled = 0;
    253     if($nd_service == 2 || $nd_service == 4 || $nd_service == 5) $tagsdisabled = 1;
    254     $urlservice = 1;
    255     if($nd_service == 1 || $nd_service == 6) $urlservice = 0;
     311    if($nd_service == 2 || $nd_service == 4 || $nd_service == 5 || $nd_service == 8) $tagsdisabled = 1;
    256312
    257313?>
     
    264320        oldservice = nd_service_js;
    265321        if(document.getElementById('nd_service_0').checked) nd_service_js = 0;
    266         else if(document.getElementById('nd_service_1').checked) nd_service_js = 1;
    267322        else if(document.getElementById('nd_service_2').checked) nd_service_js = 2;
    268323        else if(document.getElementById('nd_service_4').checked) nd_service_js = 4;
    269324        else if(document.getElementById('nd_service_5').checked) nd_service_js = 5;
    270325        else if(document.getElementById('nd_service_6').checked) nd_service_js = 6;
     326        else if(document.getElementById('nd_service_7').checked) nd_service_js = 7;
     327        else if(document.getElementById('nd_service_8').checked) nd_service_js = 8;
    271328
    272329        if(oldservice != nd_service_js) document.nd_settingsform.nd_settingschanged.value = "1";
     
    275332            switch(type) {
    276333                case 'tags' :
    277                     if(service == 2 || service == 4 || service == 5) return 1;
     334                    if(service == 2 || service == 4 || service == 5 || service == 8) return 1;
    278335                    else return 0;
    279                     break;
    280                 case 'url' :
    281                     if(service == 1 || service == 6) return 0;
    282                     else return 1;
    283336                    break;
    284337            }
     
    301354                document.getElementById('nd_whitelist_row').style.visibility = 'visible';
    302355                document.getElementById('nd_blacklist_row').style.visibility = 'visible';
    303             }
    304         }
    305 
    306         old_urlservice = nd_status('url',oldservice);
    307         new_urlservice = nd_status('url',nd_service_js);
    308 
    309         if(old_urlservice != new_urlservice) {
    310             if(new_urlservice == 1) {
    311                 document.getElementById('th_username').innerHTML = "Feed URL";
    312                 document.getElementById('nd_username').size = "50";
    313             } else {
    314                 document.getElementById('th_username').innerHTML = "Username";
    315                 document.getElementById('nd_username').size = "15";
    316356            }
    317357        }
     
    417457        <label><input id="nd_service_0" name="nd_service" type="radio" value="0" <?php if($nd_service == 0) echo 'checked="checked"' ?> onclick="nd_servicechanged();" />
    418458        delicious</label><br />
    419         <label><input id="nd_service_1" name="nd_service" type="radio" value="1" <?php if($nd_service == 1) echo 'checked="checked"' ?> onclick="nd_servicechanged();" />
    420         ma.gnolia</label><br />
    421459        <label><input id="nd_service_2" name="nd_service" type="radio" value="2" <?php if($nd_service == 2) echo 'checked="checked"' ?> onclick="nd_servicechanged();" />
    422460        Google Reader</label><br />
     
    426464        Yahoo Pipes</label><br />
    427465        <label><input id="nd_service_6" name="nd_service" type="radio" value="6" <?php if($nd_service == 6) echo 'checked="checked"' ?> onclick="nd_servicechanged();" />
    428         Jumptags</label>
     466        Jumptags</label><br />
     467        <label><input id="nd_service_7" name="nd_service" type="radio" value="7" <?php if($nd_service == 7) echo 'checked="checked"' ?> onclick="nd_servicechanged();" />
     468        Pinboard</label><br />
     469        <label><input id="nd_service_8" name="nd_service" type="radio" value="8" <?php if($nd_service == 8) echo 'checked="checked"' ?> onclick="nd_servicechanged();" />
     470        Diigo</label>
    429471        </fieldset></td>
    430472        </tr>
    431473        <tr valign="top">
    432         <th id="th_username"><label for="nd_username"><?php if($urlservice) echo "Feed URL"; else echo "Username"?></label></th>
     474        <th id="th_username"><label for="nd_username">Feed URL</label></th>
    433475        <td colspan="2">
    434         <input name="nd_username" type="text" id="nd_username" value="<?php echo $nd_username; ?>" size="<?php if($urlservice) echo "50"; else echo "15";?>" onchange="this.form.nd_settingschanged.value=1" />
     476        <input name="nd_username" type="text" id="nd_username" value="<?php echo $nd_username; ?>" size="50" onchange="this.form.nd_settingschanged.value=1" />
    435477        </td></tr>
    436478        </table>
     
    640682        <textarea readonly="readonly" name="nd_log" id="nd_log" style="width: 98%;" rows="20" cols="50"><?php echo $nd_log; ?></textarea>
    641683        <input type="button" class="button-secondary" value="Clear Log" onclick="nd_clearthelog()" /><span id="nd_clogspan" style="margin-left:5px;"></span>
     684        <br /><br /><input type="submit" name="nd_resetsettings" class="button-secondary" value="Reset All Settings" onclick="return confirm('Are you sure you want to reset all settings?')" />
    642685        <div class="submit"><input type="submit" name="save_changes" class="button-primary" value="Save Changes" onclick="nd_submitbutton = 0" /></div>
    643686        </form>
     
    692735    switch ($x) {
    693736        case 0: return 'delicious';
    694         case 1: return 'ma.gnolia';
    695737        case 2: return 'Google Reader';
    696         case 3: return 'Reddit';
    697         case 4: return 'Yahoo Pipes';
    698         case 5: return 'Jumptags';
     738        case 3: return 'Google Bookmarks';
     739        case 4: return 'Reddit';
     740        case 5: return 'Yahoo Pipes';
     741        case 6: return 'Jumptags';
     742        case 7: return 'Pinboard';
     743        case 8: return 'Diigo';
    699744    }
    700745}
    701746endif;
    702747
    703 /**
    704  * Simple service info to feed URL mapping function.
    705  *
    706  * @param $srv_id int The internal service ID number.
    707  * @param $user string The username component of the URL, or the feed itself (depending on service).
    708  * @return string The correct URL from which to obtain the feed.
    709  */
    710 if (!function_exists('neop_pstlcs_get_service_url_by_id')) :
    711 function neop_pstlcs_get_service_url_by_id($srv_id, $user) {
    712     switch($srv_id) {
    713         case 0 : return $user; // delicious
    714         case 1 : return 'http://ma.gnolia.com/rss/lite/people/'.urlencode($user); // ma.gnolia
    715         case 2 : return $user; // Google Reader
    716         case 3 : return $user; // Google Bookmarks
    717         case 4 : return $user; // Reddit
    718         case 5 : return $user; // Yahoo Pipes
    719         case 6 : return 'http://www.jumptags.com/'.urlencode($user).'?rss=xml'; // Jumptags
    720     }
    721 }
    722 endif;
    723 
    724748if (!function_exists('neop_pstlcs_update')) :
    725749function neop_pstlcs_update() {
    726     if(!($nd_version = get_option('nd_version'))) $nd_version = 280; // Because of a bug in 121, get_option('nd_version') will always be at least 150
     750    if(!($nd_version = get_option('nd_version'))) $nd_version = 300; // Because of a bug in 121, get_option('nd_version') will always be at least 150
    727751    if($nd_version < 121) {
    728752        if(get_option('nd_utw_enabled') == 'yes') {
     
    837861        $nd_version = 280;
    838862    }
     863    if($nd_version < 300) {
     864        // All services are now url services, so change usernames into urls.
     865        $service = get_option('nd_service');       
     866        if($service == 1) update_option('nd_username','http://ma.gnolia.com/rss/lite/people/'.urlencode(get_option('nd_username')));
     867        else if($service == 6) update_option('nd_username','http://www.jumptags.com/'.urlencode(get_option('nd_username')).'?rss=xml');
     868        $nd_version = 300;
     869    }
    839870    update_option('nd_version',$nd_version);
    840871}
     
    870901    $username = get_option('nd_username');
    871902
    872     if($username) { // [SERVICE]
    873         $rssurl = neop_pstlcs_get_service_url_by_id($service, $username);
     903    if($username) {
     904        $rssurl = $username;
    874905    }
    875906    else {
     
    9791010
    9801011            switch($service) { // [SERVICE] Some services need certain tags to be allowed.
    981                 case 1 : $nd_htmltags .= 'p,strong,a,img'; break; // ma.gnolia
    9821012                case 2 : $nd_htmltags .= 'br'; break; // Google Reader
    9831013                case 4 : $nd_htmltags = 'a,br'; break; // Reddit (the user's allowed tags don't matter)
     1014                case 8 : $nd_htmltags .= 'a,p,strong'; break; // Diigo
    9841015            }
    9851016
     
    10041035                switch($service) { // [SERVICE]
    10051036                    case 0: // delicious
    1006                         $bookmark['title'] = $item->get_title();
    1007                         $bookmark['link'] = $item->get_link();
    1008                         $bookmark['description'] = $item->get_description();
    1009                         $bookmark['date'] = $item->get_date('Y-m-d H:i:s T');
    1010                         if (NULL !== $item_author) {
    1011                             $bookmark['author_name'] = $item_author->get_name();
    1012                             $bookmark['author_link'] = $item_author->get_link();
    1013                         }
    1014                         $bookmark['source_link'] = $item->get_id();
    1015 
    1016                         $arr = $item->get_item_tags('', 'category');
    1017                         $bookmark['tags'] = '';
    1018                         if($arr) foreach($arr as $arritm) $bookmark['tags'] .= ",{$arritm['data']}";
    1019                         $bookmark['tags'] = ltrim($bookmark['tags'],",");
    1020                         break;
    1021                     case 1: // ma.gnolia
    10221037                        $bookmark['title'] = $item->get_title();
    10231038                        $bookmark['link'] = $item->get_link();
     
    10891104                        if($arr) foreach($arr as $arritm) $bookmark['tags'] .= ",{$arritm['data']}";
    10901105                        $bookmark['tags'] = ltrim($bookmark['tags'],",");
     1106                        break;
     1107                    case 7: // Pinboard
     1108                        $bookmark['title'] = $item->get_title();
     1109                        $bookmark['link'] = $item->get_link();
     1110                        $bookmark['description'] = $item->get_description();
     1111                        $bookmark['date'] = $item->get_date('Y-m-d H:i:s T');
     1112                        if (NULL !== $item_author) {
     1113                            $bookmark['author_name'] = $item_author->get_name();
     1114                            $bookmark['author_link'] = $item_author->get_link();
     1115                        }
     1116                        $bookmark['source_link'] = $item->get_id();
     1117                       
     1118                        $bookmark['tags'] = str_replace(' ',',',neop_pstlcs_arrelm($item->get_item_tags('http://purl.org/dc/elements/1.1/','subject'),0,'data'));                       
     1119                        break;
     1120                    case 8 : // Diigo
     1121                         $bookmark['title'] = $item->get_title();
     1122                        $bookmark['link'] = $item->get_link();
     1123                        $bookmark['description'] = $item->get_description();
     1124                        $bookmark['date'] = $item->get_date('Y-m-d H:i:s T');
     1125                        if (NULL !== $item_author) {
     1126                            $bookmark['author_name'] = $item_author->get_name();
     1127                            $bookmark['author_link'] = $item_author->get_link();
     1128                        }
     1129                        $bookmark['source_link'] = $item->get_id();
     1130
     1131                        $bookmark['tags'] = '';                     
     1132                        break;
    10911133                }
    10921134
     
    11721214                        switch($service) { // [SERVICE]
    11731215                            case 0 : //delicious
    1174                                 $tagUsername = preg_replace('/http:\/\/feeds.delicious.com\/v2\/rss\/([^\/]*).*/','$1',$username);
     1216                                $tagUsername = preg_replace('/http:\/\/feeds.delicious.com\/v2\/rss\/([^?\/]*).*/','$1',$username);
    11751217                                if($tagUsername == $username) $nd_site_tagurl = 'http://www.delicious.com/tag/'; // $username is an unrecognized url.
    1176                                 else  $nd_site_tagurl = "http://delicious.com/{$tagUsername}/";
     1218                                else  $nd_site_tagurl = "http://www.delicious.com/{$tagUsername}/";
    11771219                                break;
    1178                             case 1 : $nd_site_tagurl = "http://ma.gnolia.com/people/{$username}/tags/"; break; // ma.gnolia
    11791220                            case 2 : $nd_site_tagurl = '#'; break; // Google Reader (we should never get here)
    11801221                            case 3 : $nd_site_tagurl = '#'; break; // Google Bookmarks does not have a public tag url.
    11811222                            case 4 : $nd_site_tagurl = '#'; break; // Reddit (we should never get here)
    11821223                            case 5 : $nd_site_tagurl = '#'; break; // Yahoo pipes (we should never get here)
    1183                             case 6 : $nd_site_tagurl = "http://www.jumptags.com/{$username}/"; break; // Jumptags
     1224                            case 6 : // Jumptags
     1225                                $tagUsername = preg_replace('/http:\/\/www.jumptags.com\/([^?]*).*?rss=xml/','$1',$username);
     1226                                if($tagUsername == $username) $nd_site_tagurl = 'http://www.jumptags.com/topic/'; // $username is an unrecognized url.
     1227                                else  $nd_site_tagurl = "http://www.jumptags.com/{$tagUsername}/";
     1228                                break;
     1229                            case 7 : // Pinboard
     1230                                $tagUsername = preg_replace('/http:\/\/feeds.pinboard.in\/rss\/secret:[^\/]*\/u:([^\/]*).*/','$1',$username);
     1231                                if($tagUsername == $username) $nd_site_tagurl = 'http://pinboard.in/t:'; // $username is an unrecognized url.
     1232                                else  $nd_site_tagurl = "http://pinboard.in/u:{$tagUsername}/t:";
     1233                                break;
     1234                            case 8 : $nd_site_tagurl = '#'; break; // Diigo (we should never get here)
    11841235                        }
    11851236                        $tags = explode(',',$bookmark['tags']);
Note: See TracChangeset for help on using the changeset viewer.