Changeset 327455
- Timestamp:
- 12/31/2010 05:00:02 AM (15 years ago)
- Location:
- postalicious
- Files:
-
- 2 edited
- 3 copied
-
tags/3.0 (copied) (copied from postalicious/trunk)
-
tags/3.0/readme.txt (copied) (copied from postalicious/trunk/readme.txt) (4 diffs)
-
tags/3.0/wp-postalicious.php (copied) (copied from postalicious/trunk/wp-postalicious.php) (18 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/wp-postalicious.php (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
postalicious/tags/3.0/readme.txt
r325794 r327455 2 2 Contributors: neop 3 3 Donate link: http://neop.gbtopia.com/?p=108 4 Tags: bookmarks, delicious, ma.gnolia, Google Reader, Reddit, Yahoo Pipes4 Tags: bookmarks, delicious, pinboard, diigo, Google Reader, Reddit, Yahoo Pipes, Jumptags 5 5 Requires at least: 2.3 6 Tested up to: 3.0. 17 Stable tag: 2.9.38 9 Postalicious is a WordPress plugin that automatically posts your delicious, ma.gnolia, Google Reader, Reddit, Yahoo Pipes, or Jumptagsbookmarks to your blog.6 Tested up to: 3.0.4 7 Stable tag: 3.0 8 9 Postalicious is a WordPress plugin that automatically posts your delicious, Google Reader, Reddit, Yahoo Pipes, Jumptags, Pinboard, or Diigo bookmarks to your blog. 10 10 11 11 == Description == 12 12 13 Postalicious is a WordPress plugin that automatically posts your delicious, ma.gnolia, Google Reader, Reddit or Yahoo Pipesbookmarks 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.13 Postalicious 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. 14 14 15 15 == Installation == 16 16 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.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, 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. 18 18 19 19 == Frequently Asked Questions == … … 53 53 = Why are tag-related features disabled? = 54 54 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.55 Not 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. 56 56 57 57 == Usage == … … 62 62 63 63 * 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. 65 65 * Complete control over how often your bookmarks are posted and how many bookmarks should appear on each post. 66 66 * 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. … … 72 72 == Changelog == 73 73 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 74 81 = Version 2.9.3 = 75 82 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!) 78 85 79 86 = Version 2.9.2 = -
postalicious/tags/3.0/wp-postalicious.php
r325794 r327455 4 4 Plugin URI: http://neop.gbtopia.com/?p=108 5 5 Description: Automatically create posts with your delicious bookmarks. 6 Version: 2.9.36 Version: 3.0 7 7 Author: Pablo Gomez 8 8 Author URI: http://neop.gbtopia.com … … 10 10 11 11 if (!defined('POSTALICIOUS_UA_STRING')) { 12 define('POSTALICIOUS_UA_STRING', 'Postalicious 2.9');12 define('POSTALICIOUS_UA_STRING', 'Postalicious 3.0'); 13 13 } 14 14 … … 24 24 exit(0); // Only AJAX requests should get here so there's no reason to continue executing. 25 25 } 26 27 26 28 27 if(!class_exists('SimplePie')) { … … 187 186 $message .= neop_pstlcs_post_new(0); 188 187 } 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 189 247 if($message != '') { ?> 190 248 <div id="message" class="updated fade"><p style="line-height:150%"><strong> … … 251 309 // [SERVICE] 252 310 $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; 256 312 257 313 ?> … … 264 320 oldservice = nd_service_js; 265 321 if(document.getElementById('nd_service_0').checked) nd_service_js = 0; 266 else if(document.getElementById('nd_service_1').checked) nd_service_js = 1;267 322 else if(document.getElementById('nd_service_2').checked) nd_service_js = 2; 268 323 else if(document.getElementById('nd_service_4').checked) nd_service_js = 4; 269 324 else if(document.getElementById('nd_service_5').checked) nd_service_js = 5; 270 325 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; 271 328 272 329 if(oldservice != nd_service_js) document.nd_settingsform.nd_settingschanged.value = "1"; … … 275 332 switch(type) { 276 333 case 'tags' : 277 if(service == 2 || service == 4 || service == 5 ) return 1;334 if(service == 2 || service == 4 || service == 5 || service == 8) return 1; 278 335 else return 0; 279 break;280 case 'url' :281 if(service == 1 || service == 6) return 0;282 else return 1;283 336 break; 284 337 } … … 301 354 document.getElementById('nd_whitelist_row').style.visibility = 'visible'; 302 355 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";316 356 } 317 357 } … … 417 457 <label><input id="nd_service_0" name="nd_service" type="radio" value="0" <?php if($nd_service == 0) echo 'checked="checked"' ?> onclick="nd_servicechanged();" /> 418 458 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 />421 459 <label><input id="nd_service_2" name="nd_service" type="radio" value="2" <?php if($nd_service == 2) echo 'checked="checked"' ?> onclick="nd_servicechanged();" /> 422 460 Google Reader</label><br /> … … 426 464 Yahoo Pipes</label><br /> 427 465 <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> 429 471 </fieldset></td> 430 472 </tr> 431 473 <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> 433 475 <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" /> 435 477 </td></tr> 436 478 </table> … … 640 682 <textarea readonly="readonly" name="nd_log" id="nd_log" style="width: 98%;" rows="20" cols="50"><?php echo $nd_log; ?></textarea> 641 683 <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?')" /> 642 685 <div class="submit"><input type="submit" name="save_changes" class="button-primary" value="Save Changes" onclick="nd_submitbutton = 0" /></div> 643 686 </form> … … 692 735 switch ($x) { 693 736 case 0: return 'delicious'; 694 case 1: return 'ma.gnolia';695 737 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'; 699 744 } 700 745 } 701 746 endif; 702 747 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; // delicious714 case 1 : return 'http://ma.gnolia.com/rss/lite/people/'.urlencode($user); // ma.gnolia715 case 2 : return $user; // Google Reader716 case 3 : return $user; // Google Bookmarks717 case 4 : return $user; // Reddit718 case 5 : return $user; // Yahoo Pipes719 case 6 : return 'http://www.jumptags.com/'.urlencode($user).'?rss=xml'; // Jumptags720 }721 }722 endif;723 724 748 if (!function_exists('neop_pstlcs_update')) : 725 749 function 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 150750 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 727 751 if($nd_version < 121) { 728 752 if(get_option('nd_utw_enabled') == 'yes') { … … 837 861 $nd_version = 280; 838 862 } 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 } 839 870 update_option('nd_version',$nd_version); 840 871 } … … 870 901 $username = get_option('nd_username'); 871 902 872 if($username) { // [SERVICE]873 $rssurl = neop_pstlcs_get_service_url_by_id($service, $username);903 if($username) { 904 $rssurl = $username; 874 905 } 875 906 else { … … 979 1010 980 1011 switch($service) { // [SERVICE] Some services need certain tags to be allowed. 981 case 1 : $nd_htmltags .= 'p,strong,a,img'; break; // ma.gnolia982 1012 case 2 : $nd_htmltags .= 'br'; break; // Google Reader 983 1013 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 984 1015 } 985 1016 … … 1004 1035 switch($service) { // [SERVICE] 1005 1036 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.gnolia1022 1037 $bookmark['title'] = $item->get_title(); 1023 1038 $bookmark['link'] = $item->get_link(); … … 1089 1104 if($arr) foreach($arr as $arritm) $bookmark['tags'] .= ",{$arritm['data']}"; 1090 1105 $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; 1091 1133 } 1092 1134 … … 1172 1214 switch($service) { // [SERVICE] 1173 1215 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); 1175 1217 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}/"; 1177 1219 break; 1178 case 1 : $nd_site_tagurl = "http://ma.gnolia.com/people/{$username}/tags/"; break; // ma.gnolia1179 1220 case 2 : $nd_site_tagurl = '#'; break; // Google Reader (we should never get here) 1180 1221 case 3 : $nd_site_tagurl = '#'; break; // Google Bookmarks does not have a public tag url. 1181 1222 case 4 : $nd_site_tagurl = '#'; break; // Reddit (we should never get here) 1182 1223 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) 1184 1235 } 1185 1236 $tags = explode(',',$bookmark['tags']); -
postalicious/trunk/readme.txt
r325794 r327455 2 2 Contributors: neop 3 3 Donate link: http://neop.gbtopia.com/?p=108 4 Tags: bookmarks, delicious, ma.gnolia, Google Reader, Reddit, Yahoo Pipes4 Tags: bookmarks, delicious, pinboard, diigo, Google Reader, Reddit, Yahoo Pipes, Jumptags 5 5 Requires at least: 2.3 6 Tested up to: 3.0. 17 Stable tag: 2.9.38 9 Postalicious is a WordPress plugin that automatically posts your delicious, ma.gnolia, Google Reader, Reddit, Yahoo Pipes, or Jumptagsbookmarks to your blog.6 Tested up to: 3.0.4 7 Stable tag: 3.0 8 9 Postalicious is a WordPress plugin that automatically posts your delicious, Google Reader, Reddit, Yahoo Pipes, Jumptags, Pinboard, or Diigo bookmarks to your blog. 10 10 11 11 == Description == 12 12 13 Postalicious is a WordPress plugin that automatically posts your delicious, ma.gnolia, Google Reader, Reddit or Yahoo Pipesbookmarks 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.13 Postalicious 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. 14 14 15 15 == Installation == 16 16 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.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, 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. 18 18 19 19 == Frequently Asked Questions == … … 53 53 = Why are tag-related features disabled? = 54 54 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.55 Not 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. 56 56 57 57 == Usage == … … 62 62 63 63 * 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. 65 65 * Complete control over how often your bookmarks are posted and how many bookmarks should appear on each post. 66 66 * 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. … … 72 72 == Changelog == 73 73 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 74 81 = Version 2.9.3 = 75 82 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!) 78 85 79 86 = Version 2.9.2 = -
postalicious/trunk/wp-postalicious.php
r325794 r327455 4 4 Plugin URI: http://neop.gbtopia.com/?p=108 5 5 Description: Automatically create posts with your delicious bookmarks. 6 Version: 2.9.36 Version: 3.0 7 7 Author: Pablo Gomez 8 8 Author URI: http://neop.gbtopia.com … … 10 10 11 11 if (!defined('POSTALICIOUS_UA_STRING')) { 12 define('POSTALICIOUS_UA_STRING', 'Postalicious 2.9');12 define('POSTALICIOUS_UA_STRING', 'Postalicious 3.0'); 13 13 } 14 14 … … 24 24 exit(0); // Only AJAX requests should get here so there's no reason to continue executing. 25 25 } 26 27 26 28 27 if(!class_exists('SimplePie')) { … … 187 186 $message .= neop_pstlcs_post_new(0); 188 187 } 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 189 247 if($message != '') { ?> 190 248 <div id="message" class="updated fade"><p style="line-height:150%"><strong> … … 251 309 // [SERVICE] 252 310 $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; 256 312 257 313 ?> … … 264 320 oldservice = nd_service_js; 265 321 if(document.getElementById('nd_service_0').checked) nd_service_js = 0; 266 else if(document.getElementById('nd_service_1').checked) nd_service_js = 1;267 322 else if(document.getElementById('nd_service_2').checked) nd_service_js = 2; 268 323 else if(document.getElementById('nd_service_4').checked) nd_service_js = 4; 269 324 else if(document.getElementById('nd_service_5').checked) nd_service_js = 5; 270 325 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; 271 328 272 329 if(oldservice != nd_service_js) document.nd_settingsform.nd_settingschanged.value = "1"; … … 275 332 switch(type) { 276 333 case 'tags' : 277 if(service == 2 || service == 4 || service == 5 ) return 1;334 if(service == 2 || service == 4 || service == 5 || service == 8) return 1; 278 335 else return 0; 279 break;280 case 'url' :281 if(service == 1 || service == 6) return 0;282 else return 1;283 336 break; 284 337 } … … 301 354 document.getElementById('nd_whitelist_row').style.visibility = 'visible'; 302 355 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";316 356 } 317 357 } … … 417 457 <label><input id="nd_service_0" name="nd_service" type="radio" value="0" <?php if($nd_service == 0) echo 'checked="checked"' ?> onclick="nd_servicechanged();" /> 418 458 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 />421 459 <label><input id="nd_service_2" name="nd_service" type="radio" value="2" <?php if($nd_service == 2) echo 'checked="checked"' ?> onclick="nd_servicechanged();" /> 422 460 Google Reader</label><br /> … … 426 464 Yahoo Pipes</label><br /> 427 465 <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> 429 471 </fieldset></td> 430 472 </tr> 431 473 <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> 433 475 <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" /> 435 477 </td></tr> 436 478 </table> … … 640 682 <textarea readonly="readonly" name="nd_log" id="nd_log" style="width: 98%;" rows="20" cols="50"><?php echo $nd_log; ?></textarea> 641 683 <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?')" /> 642 685 <div class="submit"><input type="submit" name="save_changes" class="button-primary" value="Save Changes" onclick="nd_submitbutton = 0" /></div> 643 686 </form> … … 692 735 switch ($x) { 693 736 case 0: return 'delicious'; 694 case 1: return 'ma.gnolia';695 737 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'; 699 744 } 700 745 } 701 746 endif; 702 747 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; // delicious714 case 1 : return 'http://ma.gnolia.com/rss/lite/people/'.urlencode($user); // ma.gnolia715 case 2 : return $user; // Google Reader716 case 3 : return $user; // Google Bookmarks717 case 4 : return $user; // Reddit718 case 5 : return $user; // Yahoo Pipes719 case 6 : return 'http://www.jumptags.com/'.urlencode($user).'?rss=xml'; // Jumptags720 }721 }722 endif;723 724 748 if (!function_exists('neop_pstlcs_update')) : 725 749 function 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 150750 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 727 751 if($nd_version < 121) { 728 752 if(get_option('nd_utw_enabled') == 'yes') { … … 837 861 $nd_version = 280; 838 862 } 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 } 839 870 update_option('nd_version',$nd_version); 840 871 } … … 870 901 $username = get_option('nd_username'); 871 902 872 if($username) { // [SERVICE]873 $rssurl = neop_pstlcs_get_service_url_by_id($service, $username);903 if($username) { 904 $rssurl = $username; 874 905 } 875 906 else { … … 979 1010 980 1011 switch($service) { // [SERVICE] Some services need certain tags to be allowed. 981 case 1 : $nd_htmltags .= 'p,strong,a,img'; break; // ma.gnolia982 1012 case 2 : $nd_htmltags .= 'br'; break; // Google Reader 983 1013 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 984 1015 } 985 1016 … … 1004 1035 switch($service) { // [SERVICE] 1005 1036 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.gnolia1022 1037 $bookmark['title'] = $item->get_title(); 1023 1038 $bookmark['link'] = $item->get_link(); … … 1089 1104 if($arr) foreach($arr as $arritm) $bookmark['tags'] .= ",{$arritm['data']}"; 1090 1105 $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; 1091 1133 } 1092 1134 … … 1172 1214 switch($service) { // [SERVICE] 1173 1215 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); 1175 1217 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}/"; 1177 1219 break; 1178 case 1 : $nd_site_tagurl = "http://ma.gnolia.com/people/{$username}/tags/"; break; // ma.gnolia1179 1220 case 2 : $nd_site_tagurl = '#'; break; // Google Reader (we should never get here) 1180 1221 case 3 : $nd_site_tagurl = '#'; break; // Google Bookmarks does not have a public tag url. 1181 1222 case 4 : $nd_site_tagurl = '#'; break; // Reddit (we should never get here) 1182 1223 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) 1184 1235 } 1185 1236 $tags = explode(',',$bookmark['tags']);
Note: See TracChangeset
for help on using the changeset viewer.