Changeset 1425
- Timestamp:
- 03/16/07 10:17:44 (2 years ago)
- Files:
-
- feedmelinks (modified) (1 prop)
- feedmelinks/.cvsignore (modified) (1 diff)
- feedmelinks/.htaccess-global (modified) (2 diffs)
- feedmelinks/FAQ/index.php (modified) (4 diffs)
- feedmelinks/admin/disable-user.php (modified) (2 diffs)
- feedmelinks/aim/bot/klaus.pl (modified) (3 diffs)
- feedmelinks/aim/hello.php (added)
- feedmelinks/aim/open-aim-window.php (added)
- feedmelinks/bin/add-link.pl (modified) (7 diffs)
- feedmelinks/bin/hybrid-to-xml.pl (modified) (1 diff)
- feedmelinks/categorize.php (modified) (3 diffs)
- feedmelinks/import/processing.php (modified) (1 diff)
- feedmelinks/import/ready-to-import.php (modified) (1 diff)
- feedmelinks/invite/index.php (modified) (3 diffs)
- feedmelinks/lib/FeedMeLinks/Bot.pm (modified) (14 diffs)
- feedmelinks/login.php (modified) (1 diff)
- feedmelinks/script/funcs.js (modified) (1 diff)
- feedmelinks/style/main.css (modified) (7 diffs)
- feedmelinks/submit-link.php (modified) (2 diffs)
- feedmelinks/testing/contacts.php (modified) (3 diffs)
- feedmelinks/users.php (modified) (1 diff)
- feedmelinks/wall-of-ancients-uncached.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedmelinks
- Property svn:ignore changed from
.htaccess
cgi-bin
cheat
logs
portal.php
testing
the-lost-urls
utils.inc.php
wall-of-ancients.php
work
*webalizer*
_assets
_profiling
TODO
info.php
setup
_comments
local-remote-root
.DS_Store
flash
_logs
usage
mint
cgi-bin
dev
please
usr
blog
xfer
to
.htaccess
cgi-bin
cheat
logs
portal.php
testing
the-lost-urls
utils.inc.php
wall-of-ancients.php
work
*webalizer*
_assets
_profiling
TODO
info.php
setup
_comments
local-remote-root
.DS_Store
flash
_logs
usage
mint
cgi-bin
dev
please
usr
blog
xfer
_backups
- Property svn:ignore changed from
feedmelinks/.cvsignore
r1406 r1425 29 29 xfer 30 30 _backups 31 .cpan feedmelinks/.htaccess-global
r1413 r1425 20 20 RewriteRule ^register /login?op=inputNewAccount [L] 21 21 22 # secret about page 22 # meta info 23 RewriteRule ^misc/ChangeLog http://toolstomaketools.svnrepository.com/codepot/trac.cgi/log/feedmelinks [L] 23 24 RewriteRule ^1$ /misc/secret-about.php 24 25 … … 46 47 RewriteRule ^recategorize/([0-9]+)/d$ /categorize?op=change&id=$1&debug=1 [L] 47 48 49 # peeps 48 50 RewriteRule ^peeps/?$ /contacts/index [L] 49 51 50 52 # xml API: 51 RewriteRule ^xml/authenticate(.*)$ /authenticate$1 [L]52 RewriteRule ^xml/(f|tag)/(.+)$ /folder-as-xml?folder=$2 [L]53 RewriteRule ^api/tag/(.+)$ /folder-as-xml?folder=$1 [L]54 RewriteRule ^(xml|api)/tags$ /tags-as-xml [L]55 RewriteRule ^ xml/user/([0-9a-z]+)$ /users-links-as-xml?user=$1[L]56 RewriteRule ^xml/set/comment /api/comment57 RewriteRule ^(xml|api)/peeps$ /peeps-as-xml [L]58 RewriteRule ^(xml|api)/recent$ /api/recent-as-xml.php [L]59 RewriteRule ^(xml|api)/recent/(.+)$ /api/recent-as-xml.php?user=$1 [L]60 RewriteRule ^api/backroom/(.*)$ /api/restricted/secure-call.php?call=$1 [L]53 RewriteRule ^xml/authenticate(.*)$ /authenticate$1 [L] 54 RewriteRule ^xml/(f|tag)/(.+)$ /folder-as-xml?folder=$2 [L] 55 RewriteRule ^api/tag/(.+)$ /folder-as-xml?folder=$1 [L] 56 RewriteRule ^(xml|api)/tags$ /tags-as-xml [L] 57 RewriteRule ^(xml|api)/user/([0-9a-z]+)$ /users-links-as-xml?user=$2 [L] 58 RewriteRule ^xml/set/comment /api/comment 59 RewriteRule ^(xml|api)/peeps$ /peeps-as-xml [L] 60 RewriteRule ^(xml|api)/recent$ /api/recent-as-xml.php [L] 61 RewriteRule ^(xml|api)/recent/(.+)$ /api/recent-as-xml.php?user=$2 [L] 62 RewriteRule ^api/backroom/(.*)$ /api/restricted/secure-call.php?call=$1 [L] 61 63 62 RewriteRule ^api/rename/(.*)$ /api/core/index.php?op=rename&user=$1 [L]63 RewriteRule ^api/add_tags/(.*)$ /api/core/index.php?op=add_tags&user=$1 [L]64 RewriteRule ^api/search(.*)$ /search-as-xml.php$1 [L]64 RewriteRule ^api/rename/(.*)$ /api/core/index.php?op=rename&user=$1 [L] 65 RewriteRule ^api/add_tags/(.*)$ /api/core/index.php?op=add_tags&user=$1 [L] 66 RewriteRule ^api/search(.*)$ /search-as-xml.php$1 [L] 65 67 66 68 # JSON API feedmelinks/FAQ/index.php
r1390 r1425 46 46 <li><a href="#q6_0">What is the naming convention / url schema for Feed Me Links? </a></li> 47 47 <li><a href="#xml_rss">RSS Feeds - How to syndicate your links</a></li> 48 <li><a href="# apis">Programming Feed Me Links - The Feed Me Links API</a></li>48 <li><a href="#API">Programming Feed Me Links - The Feed Me Links API</a></li> 49 49 <li><a href="#developers">Programming Feed Me Links - Developer Sandbox</a></li> 50 50 … … 297 297 <div class="q">Can I add links via email?</div> 298 298 <div class="a"> 299 Yes! 300 <br /> 299 Yes but no. :-( 300 <br/> 301 Unfortunately, I've disabled this feature for now because it's too easy to send mail as someone else. if anyone knows how to verify SPF records or something liek that, let me know. 302 <p /> 303 Soon we'll do what Flickr (wisely) does and generate you a unique email address for sending links by name; knowing that email address wil constitute a kind of "password" that guarantees some level of security. 304 <p /> 305 301 306 Send emails from your mail program (or script) to "add @ feedmelinks . com" (no spaces) 302 307 <p/> … … 396 401 <div> 397 402 <a name="apis"></a> 403 <a name="api"></a> 404 <a name="API"></a> 398 405 <div class="q">Programming Feed Me Links - The Feed Me Links API</div> 399 406 <div class="a"> … … 408 415 409 416 <b>retrieve your links as XML</b>:<br /> 410 <span class="subtle">http://feedmelinks.com</span>/xml/user/<b>USERNAME</b><br /> 417 <span class="subtle">http://feedmelinks.com</span>/api/user/<b>YOUR_USERNAME</b><br /> 418 <br /> 419 420 <b>retrieve the last 15 public links as XML:</b>:<br /> 421 <span class="subtle">http://feedmelinks.com</span>/api/recent<br /> 422 <br /> 423 424 <b>retrieve the last 15 public links of someone else as XML:</b>:<br /> 425 <span class="subtle">http://feedmelinks.com</span>/api/recent/<b>THEIR_USERNAME</b><br /> 411 426 <br /> 412 427 feedmelinks/admin/disable-user.php
r1352 r1425 11 11 $result = disable_user( $user ); 12 12 else if( $op == "re_enable" ) 13 $result = re_enable_user( $user);13 $result = re_enable_user( $user, $manual = true ); 14 14 else if( $op == "notify_expiring_soon" ) 15 15 $result = notify_expiring_soon($user); 16 17 echo h1($op . "ing $user"); 16 18 17 19 if( $result ) { … … 30 32 <form method="post"> 31 33 <select name="op"> 34 <option value="re_enable">re-enable</option> 35 <option value="disable">disable</option> 32 36 <option value="expire">expire</option> 33 <option value="disable">disable</option>34 <option value="re_enable">re-enable</option>35 37 <option value="notify_expiring_soon">warn they are about to expire</option> 36 38 </select> feedmelinks/aim/bot/klaus.pl
r1402 r1425 2 2 use strict; 3 3 use Module::Reload; 4 use Net::OSCAR qw(:standard );4 use Net::OSCAR qw(:standard :loglevels); 5 5 use Data::Dumper; 6 6 use FeedMeLinks::Environment; … … 12 12 my $aimbot = Net::OSCAR->new(capabilities => [qw(buddy_icons typing_status)]); 13 13 14 $aimbot->set_callback_im_in (\&respond); 15 $aimbot->signon( "cityoflinks", "fuzzlebuzzle" ); 14 $aimbot->loglevel( OSCAR_DBG_NOTICE ); 15 $aimbot->set_callback_im_in(\&respond); 16 print FeedMeLinks::Environment::get_aim_bot_user() . "\n"; 17 print FeedMeLinks::Environment::get_aim_bot_password() . "\n";; 18 $aimbot->signon( FeedMeLinks::Environment::get_aim_bot_user(), FeedMeLinks::Environment::get_aim_bot_password() ); 16 19 20 # doesn't work 17 21 #open( ICON, "48x48heart.gif" ) || die("can't open icon file: $!"); 18 22 #binmode( ICON ); … … 28 32 sub respond { 29 33 my ($aim, $sender, $message, $away) = @_; 34 35 print "respond called\n"; 30 36 31 37 # has to happen at the main klaus level so we can force a reload of all the other commands in the module feedmelinks/bin/add-link.pl
r1402 r1425 28 28 my $tagName = "new"; 29 29 30 open(LOG, ">>" . get_webserver_root() . "/_logs/mail.log") or die "can't open file";30 open(LOG, ">>" . FeedMeLinks::Environment::get_webserver_root() . "/_logs/mail.log") or die "can't open file"; 31 31 print LOG "--- starting run ---\n" if( $verbose ); 32 32 … … 78 78 if( $headersDone && $title && $submitter && $link ) { 79 79 print LOG "adding link to db\n" if( $verbose ); 80 my $dsn = "DBI:mysql:database=" . get_database_name() . ";host=localhost"; # FIXME: need to retrieve this from our config arrays...81 my $dbh = DBI->connect($dsn, get_database_user(),get_database_password() );80 my $dsn = "DBI:mysql:database=" . FeedMeLinks::Environment::get_database_name() . ";host=localhost"; # FIXME: need to retrieve this from our config arrays... 81 my $dbh = DBI->connect($dsn, FeedMeLinks::Environment::get_database_user(), FeedMeLinks::Environment::get_database_password() ); 82 82 83 83 if( ! $dbh ) { … … 86 86 } 87 87 88 my $qs = "SELECT userid, password FROM linksUsers WHERE email = ? OR email = ? LIMIT 1";88 my $qs = "SELECT userid, password FROM users WHERE email = ? OR email = ? LIMIT 1"; 89 89 my $sth = $dbh->prepare( $qs ); 90 90 … … 111 111 print LOG "$now [link-by-mail] $dbUser added $linkID\n"; 112 112 113 $qs = "SELECT ID FROM linksGroups WHERE name = ? AND userid = ? AND isPrivate IS NULL";113 $qs = "SELECT ID FROM tags WHERE name = ? AND userid = ? AND isPrivate IS NULL"; 114 114 $sth = $dbh->prepare( $qs ); 115 115 $sth->execute( $tagName, $dbUser ); … … 118 118 if( ! $tagID ) { 119 119 print LOG "couldn't find a tag named $tagName; trying to insert it\n" if( $verbose ); 120 $qs = "INSERT INTO linksGroups VALUES( NULL, ?, ?, NULL, NULL)";120 $qs = "INSERT INTO tags VALUES( NULL, ?, ?, NULL, NULL)"; 121 121 print LOG "SQL: $qs with $dbUser, $tagName\n" if( $verbose ); 122 122 $sth = $dbh->prepare( $qs ); … … 136 136 if( $tagID ) { 137 137 print LOG "found existing tag as ID $tagID\n" if( $verbose ); 138 $qs = "INSERT INTO links CategoriesXRef VALUES( ?, ?)";138 $qs = "INSERT INTO links_tags_xref VALUES( ?, ?)"; 139 139 $sth = $dbh->prepare( $qs ); 140 140 $sth->execute( $linkID, $tagID ); … … 163 163 print LOG "--- ending run ---\n\n" if( $verbose ); 164 164 close(LOG); 165 166 From root@raptor.webhostserver.biz Thu Mar 08 13:20:49 2007167 Return-path: <root@raptor.webhostserver.biz>168 Envelope-to: add@feedmelinks.com169 Delivery-date: Thu, 08 Mar 2007 13:20:49 -0700170 Received: from fml by raptor.webhostserver.biz with local-bsmtp (Exim 4.63)171 (envelope-from <root@raptor.webhostserver.biz>)172 id 1HPP6P-0007Ie-RH173 for add@feedmelinks.com; Thu, 08 Mar 2007 13:20:45 -0700174 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on175 raptor.webhostserver.biz176 X-Spam-Level:177 X-Spam-Status: No, score=-0.0 required=5.0 tests=NO_RELAYS autolearn=ham178 version=3.1.8179 Received: from root by raptor.webhostserver.biz with local (Exim 4.63)180 (envelope-from <root@raptor.webhostserver.biz>)181 id 1HPP6O-0007IO-ND182 for add@feedmelinks.com; Thu, 08 Mar 2007 13:20:41 -0700183 To: add@feedmelinks.com184 Subject: test185 Message-Id: <E1HPP6O-0007IO-ND@raptor.webhostserver.biz>186 From: root <root@raptor.webhostserver.biz>187 Date: Thu, 08 Mar 2007 13:20:40 -0700188 189 test support190 feedmelinks/bin/hybrid-to-xml.pl
r1375 r1425 1 1 #!/usr/local/bin/perl 2 3 # convert from the delicious hybrid export format to valid XML 2 4 3 5 my $d = $ARGV[0]; feedmelinks/categorize.php
r1360 r1425 176 176 177 177 <div style="border-bottom: 1px solid #dddddd; margin-bottom: 1px; padding: 0px;"> 178 178 179 <table border="0" cellspacing="0" cellpadding="0"> 179 180 <tr> 180 181 <td valign="top"> 181 <h2><?= $opVerb ?> <input type="text" size="64" maxlength="127" name="name" value="<?= $from == "toolbar" ? $name : o( $name ) ?>"> 182 <h2><?= $opVerb ?> 183 <a class="forcehot" title="<?= $url ?>" onClick="javascript:history.go( -1 );"><?= getCompactString( preg_replace( "/http:\/\//", "", preg_replace( "/www\./", "", $url)), 48 ) ?></a> 184 <p/> 185 <input type="text" size="64" maxlength="127" name="name" value="<?= $from == "toolbar" ? $name : o( $name ) ?>"> 182 186 <?php 183 187 if( $debug ) { … … 195 199 if( link_exists( $url )) { 196 200 ?> 197 <input type="hidden" name="is _private" value="checked" />201 <input type="hidden" name="isPrivate" value="checked" /> 198 202 <?php 199 203 # otherwise the user can choose … … 202 206 <br /> 203 207 <a href="javascript:setPrivate();">Save as private</a>? 204 <input type="checkbox" name="is _private" />208 <input type="checkbox" name="isPrivate" /> 205 209 <br /> 206 210 <?php feedmelinks/import/processing.php
r1375 r1425 50 50 $comment = $x[1]; 51 51 52 $inserted_id = addLinkSimple( $url, $name, $user, 1);52 $inserted_id = addLinkSimple( $url, $name, $user, $isPrivate = 1, $from = "import" ); 53 53 54 54 if( !$inserted_id ) { feedmelinks/import/ready-to-import.php
r1422 r1425 60 60 fire( "FML Debug: import request - $ls, $ts, $tr", "user $u importing $ls links and $ts tags with T:L ratio of $tr\nhttp://feedmelinks.com/u/$u" ); 61 61 if( $tr > $max_tags_to_links_ratio && $ls > 5) 62 log_mesg_to( " WARN. user $u importing $ls links and $ts tags with T:L ratio of $tr", "security" );62 log_mesg_to( "[big import request] $u," . get_ip() . ", $ls links, $ts tags, $tr, ratio", "security" ); 63 63 64 64 #tell( "Debugging Check:", "We found " . $ls . " links and " . $ts . " tags, which is allowed. Proceeding." ); feedmelinks/invite/index.php
r1408 r1425 37 37 38 38 function get_invite_boilerplate( $user ) { 39 return "Feed Me Links just launched a new AIM app for savinv yourlinks directly from AIM. It's great for folks who are too busy to sign into a web browser but still want a way to capture and share incoming links. Link, tag, share, and connect from Adium, Trillian, or plain ol'e AIM.39 return "Feed Me Links just launched a new AIM app for adding links directly from AIM. It's great for folks who are too busy to sign into a web browser but still want a way to capture and share incoming links. Link, tag, share, and connect from Adium, Trillian, or plain ol'e AIM. 40 40 41 41 To start playing around, just click http://feedmelinks.com/aim/hello 42 43 Peace!44 42 45 43 -- … … 52 50 ?> 53 51 52 <style type="text/css"> 53 #fake_email { 54 padding: 2.0em; 55 margin: 2.0em; 56 border: 1px #cccccc dashed; 57 background-color: #fafafa; 58 } 59 #fake_email textarea { 60 background-color: #eeeeee; 61 } 62 #fake_email_note { 63 color: red; 64 font-size: 80%; 65 } 66 </style> 67 68 54 69 <form name="invite_form"> 55 70 <input type="hidden" name="op" value="send" /> 56 71 72 <h1 style="margin-left: 2.0em;"> 73 Invite your peeps to join the AIM orgy! 74 </h1> 75 57 76 <div id="fake_email"> 58 <h1>59 Invite your peeps to AIM60 </h1>61 62 77 <p style="font-family: sans-serif;"> 63 78 64 79 <p> 65 <b >From</b>: <?= $u ?> <<?= getEmailAddressForUser( $u ) ?>>80 <big><b>From</b></big>: <?= $u ?> <<?= getEmailAddressForUser( $u ) ?>> 66 81 </p> 67 82 68 <p>69 <b>To</b>: <?= $peeps ?><br />83 <p> 84 <big><b>To</b></big>: <?= $peeps ?><br /> 70 85 </p> 71 86 <p> 72 <b >Subject</b>: <?= get_invite_sub( $u ) ?><br />87 <big><b>Subject</b></big>: <?= get_invite_sub( $u ) ?><br /> 73 88 </p> 74 89 <br /> … … 78 93 Hi! 79 94 </p> 95 <div id="fake_email_note"> 96 ( Your message here: ) 97 </div> 80 98 81 99 <textarea name="user_message" rows="5" cols="60"></textarea> feedmelinks/lib/FeedMeLinks/Bot.pm
r1401 r1425 15 15 16 16 my $logfile = FeedMeLinks::Environment::get_webserver_root() . "/_logs/aim.log"; 17 print "opening $logfile\n";18 17 open(LOG, ">>" . $logfile) or die "can't open log $logfile"; 19 18 … … 23 22 select $ofh; 24 23 } 25 log_mesg( \*LOG, "starting run" );26 24 27 25 my $num_recent = 5; 28 my $www = get_proxy( FeedMeLinks::Environment::get_bot_ user(), FeedMeLinks::Environment::get_bot_password());26 my $www = get_proxy( FeedMeLinks::Environment::get_bot_puppetmaster_user(), FeedMeLinks::Environment::get_bot_puppetmaster_password()); 29 27 my $site = "http://www." . FeedMeLinks::Environment::get_domain(); 30 28 … … 84 82 # set our session state 85 83 $sessions_ref->{$sender}->{"last_link"} = $link_id; 84 $sessions_ref->{$sender}->{"last_name"} = $name; 86 85 $sessions_ref->{$sender}->{"last_action"} = "added_link"; 87 86 $sessions_ref->{$sender}->{"added_tags"} = 0; … … 164 163 165 164 # COMMAND: PEEPS ############################################################### 166 } elsif( $fml_username && $message =~ m/ peeps/ ) {165 } elsif( $fml_username && $message =~ m/^\s*peeps\s*$/ ) { 167 166 $aim->send_im($sender, "Look at you, you have <a href='$site/peeps'>" . ( keys %{$sessions_ref->{$sender}->{"peeps"}} ) . " peeps</a>!" ); 168 167 … … 182 181 183 182 # COMMAND: HELP ############################################################### 184 } elsif( $message =~ m/help/ || $message =~ m/commands/ || $message =~ m/\?/ ) {183 } elsif( $message =~ m/help/ || $message =~ m/commands/ || $message =~ m/\?/ || $message =~ m/^\shi\s*$/ || $message =~ m/^\shello\s*$/ || $message =~ m/^\syo\s*$/ ) { 185 184 log_mesg( \*LOG, "help", " $sender" ); 186 185 … … 193 192 log_mesg( \*LOG, "status", " $sender" ); 194 193 $aim->send_im($sender, "<b>DEBUG DUMP</b>:\nsender: $sender\nmessage: $message" ); 195 print Dumper( $sessions_ref ) . "\n";196 194 197 195 # COMMAND: CREDITS ############################################################### … … 220 218 if( $response_code == "success" ) { 221 219 $aim->send_im($sender, h("Thanks! We renamed <a href='$site/$link'><b>$pretty_name</b></a>.")); 220 $sessions_ref->{$sender}->{"last_name"} = $pretty_name; 222 221 if( $sessions_ref->{$sender}->{"added_tags"} == 0 ) { 223 222 $aim->send_im($sender, h(get_message( "add_tags"))); … … 229 228 230 229 # COMMAND: SHARE ############################################################### 231 } elsif( $fml_username && $sessions_ref->{$sender}->{"last_link"} && $ sessions_ref->{$sender}->{"renamed"} == 0 && $message =~ m/\s*share\s*$/ ) {230 } elsif( $fml_username && $sessions_ref->{$sender}->{"last_link"} && $message =~ m/\s*share\s*$/ ) { 232 231 233 232 # cache anyone who we CAN share with in the session, first … … 252 251 . " peeps</a>, " 253 252 . ( keys %{$sessions_ref->{$sender}->{"shareables"}} ) 254 . " (" . $shareables_string . ") " 255 . " are using the Feed Me Links bot, and " 256 . ( keys %{$online_peeps} ) 257 . ($online_string ? " (" . $online_string . ") " : "") 258 . " are online to share with you right now." ); 259 my $delta_not_using = (keys %{$sessions_ref->{$sender}->{"peeps"}}) - (keys %{$sessions_ref->{ $sender }{ "shareables" }}); 260 if( $delta_not_using ) { 261 $aim->send_im( $sender, h("$delta_not_using of your peeps aren't using the cool Feed Me Links bot yet. " 262 . "Want to invite them so you can share and chat? <a href='$site/invite?mode=not_on_aim'><b>Click to invite</b></a> " )); 263 } 253 . " (" . $shareables_string . ")" 254 . " are using the Feed Me Links bot." ); 255 my $delta_not_using = (keys %{$sessions_ref->{$sender}->{"peeps"}}) - (keys %{$sessions_ref->{ $sender }{ "shareables" }}); 256 if( $delta_not_using ) { 257 $aim->send_im( $sender, h( "($delta_not_using of your peeps aren't using the cool Feed Me Links bot yet. " 258 . "Want to invite them so you can share and chat? <a href='$site/invite?mode=not_on_aim'><b>Click to invite</b></a>.)" )); 259 } 260 261 $aim->set_callback_im_ok(\&sent_message); 262 # FIXME: send to the online-er's here. 263 log_mesg( \*LOG, "starting loop of send to peeps" ); 264 while( my ($fml_user, $aim_name) = each( %{ $sessions_ref->{$sender}->{"shareables"} })) { 265 #while( my ($fml_user, $aim_name) = each( %{$online_peeps})) { 266 267 my $result_code = 268 my $mesg = h("Hi $fml_user, $sender wants to share this with you:\n<a href='" .$sessions_ref->{$sender}{"last_link"} . "'>" . $sessions_ref->{$sender}{"last_name"} . "</a>"); 269 $aim->send_im( $aim_name, $mesg ); # FIXME need link name 270 log_mesg( \*LOG, "sent $mesg to $aim_name" ); 271 } 272 273 # FIXME: print "sent to : foo, bar, etc 274 264 275 265 276 # COMMAND: TAG ############################################################### … … 322 333 log_mesg( \*LOG, "debug", "summary: $summary" ); 323 334 $aim->send_im($sender, h("You have <a href='$site/u/" . encode( $sessions_ref->{$sender}{"fml_username"}) . "/tags/" . encode($message) 324 . "'>$num_links links</a> tagged with $message, including $summary" ));335 . "'>$num_links links</a> tagged with <b><font size='6'>$message</font></b>, including $summary" )); 325 336 } 326 337 327 # COMMAND: SHOW TAG###############################################################328 } elsif( $fml_username && $sessions_ref->{$sender}{"peeps"}{$message} ) {338 # COMMAND: PEEP ############################################################### 339 } elsif( $fml_username && exists $sessions_ref->{$sender}{"peeps"}{$message} ) { 329 340 my $peep = encode( $message ); 330 341 $aim->send_im($sender, h("<a href='$site/u/$peep'>$peep</a> is your peep! APE CANNOT KILL APE!" )); 342 343 my $url = "$site/api/recent/$peep"; 344 log_mesg( \*LOG, "debug", "api call to $url" ); 345 346 my $response = $www->get( $url, []); 347 my $nodes = XML::XPath->new(xml => $response->content)->findnodes("/rest/response/link"); 348 my $total = "" . XML::XPath->new(xml => $response->content)->findnodes("/rest/response/\@num_links"); 349 my $summary = summarize_linklist( $nodes ); 350 $summary = Encode::encode_utf8( $summary ); # FIXME: this fucks things up, spec. see pheezy's HÃ¥kon Wium Lie link 351 if( length( $summary ) > 3 ) { 352 $aim->send_im($sender, h("Ape-hanger <b>$peep</b>'s recent links: (<a href='$site/u/$peep'>$total total</a>)\n$summary")); 353 } else { 354 $aim->send_im($sender, "<b>$message</b>"); 355 $aim->send_im($sender, "(perhaps you'd like to add some links on this subject? :-) )"); 356 } 331 357 332 358 } else { … … 347 373 log_mesg( \*LOG, "debug", " $url" ); 348 374 349 if( 1 ) {350 # FIXME EMERGENCY: if( $sessions_ref && $sessions_ref->{$sender} && $sessions_ref->{$sender}->{"proxy"}) {351 375 my $response = $www->get( $url, []); 352 376 my $nodes = XML::XPath->new(xml => $response->content)->findnodes("/rest/response/link"); … … 354 378 my $response_code = "" . XML::XPath->new(xml => $response->content)->findnodes("/rest/response/\@code"); 355 379 if( $response_code == "success" ) { 356 my $summary = ""; 357 my $max = $num_recent; 358 my $c = 0; 359 foreach my $link_node ($nodes->get_nodelist) { 360 if( $c < $max ) { 361 $summary .= 362 "<a href='" 363 . $link_node->findnodes( "url/text()" ) 364 . "'>" 365 . $link_node->findnodes( "name/text()" ) 366 . "</a>, "; 367 }; 368 ++ $c; 369 } 370 #log_mesg( \*LOG, "debug", "summary: $summary" ); 380 my $summary = summarize_linklist( $nodes ); 371 381 log_mesg( \*LOG, "search", "found $message" ); 372 382 if( length( $summary ) > 3 ) { … … 377 387 } 378 388 } 379 }380 389 } 381 390 … … 385 394 # END MAIN ZZZZZZZZ HERE COME THOSE FORM-FEEDS! 386 395 396 sub sent_message { 397 my( $aim, $to, $mesg_id) = @_; 398 log_mesg( \*LOG, "debug", "message to $to went thru ($mesg_id)"); 399 } 400 401 sub summarize_linklist { 402 my $nodes = $_[0]; 403 my $summary = ""; 404 405 my $max = $num_recent; 406 my $c = 0; 407 foreach my $link_node ($nodes->get_nodelist) { 408 if( $c < $max ) { 409 $summary .= 410 "<a href='" 411 . $link_node->findnodes( "url/text()" ) 412 . "'>" 413 . $link_node->findnodes( "name/text()" ) 414 . "</a>, "; 415 }; 416 ++ $c; 417 } 418 return $summary; 419 } 387 420 388 421 sub get_printable_user_string_from_hash { feedmelinks/login.php
r1393 r1425 166 166 167 167 $folderId = addFolder( "public", $userId ); 168 $folderId = addFolder( "linkpocket", $userId ); 169 $folderId = addPrivateFolder( "private", $userId ); 168 $folderId = addFolder( "music", $userId ); 169 $folderId = addFolder( "movies", $userId ); 170 $folderId = addFolder( "books", $userId ); 171 $folderId = addFolder( "work", $userId ); 172 $folderId = addPrivateFolder( "private", $userId ); # FIXME: is this still correct? 170 173 171 174 $authenticated = 1; feedmelinks/script/funcs.js
r1381 r1425 13 13 14 14 function setPrivate() { 15 document.forms.funnelForm.is _private.checked = !(document.forms.funnelForm.is_private.checked);15 document.forms.funnelForm.isPrivate.checked = !(document.forms.funnelForm.isPrivate.checked); 16 16 //return true; 17 17 } feedmelinks/style/main.css
r1409 r1425 81 81 .folder_row {} 82 82 .fr { 83 height: 26px;84 padding-top: 4px;85 background-color: #dddddd;86 border-bottom: 1px solid #aaaaaa;83 height: 26px; 84 padding-top: 4px; 85 background-color: #dddddd; 86 border-bottom: 1px solid #aaaaaa; 87 87 } 88 88 89 89 .right_justified_num_column {} 90 90 .fr > .rn { 91 float: left;92 width: 60px;93 text-align: right;94 margin-right: 10px;91 float: left; 92 width: 60px; 93 text-align: right; 94 margin-right: 10px; 95 95 } 96 96 97 97 .fr > .l { 98 float: left;98 float: left; 99 99 } 100 100 101 101 .fr > .r { 102 float: right;103 width: 60px;102 float: right; 103 width: 60px; 104 104 } 105 105 … … 121 121 122 122 .tagcloud > a, .tagcloud > a:visited { 123 color: #FF6600;123 color: #FF6600; 124 124 } 125 125 … … 130 130 131 131 a.hot, a.hot:link, a.hot:active, .hot { 132 color: #FF6600; 132 color: #FF6600; 133 } 134 135 .forcehot { 136 cursor: pointer; 137 border-bottom: 1px dotted red; 138 } 139 140 a.forcehot:hover { 141 text-decoration: none; 133 142 } 134 143 … … 140 149 a.underhot:active, .underhot:active, a.underhot:hover, .underhot:hover { 141 150 border-bottom: 1px dotted black; 142 color: black;151 color: black; 143 152 text-decoration: none; 144 153 } … … 314 323 font-family: verdana, sans-serif; 315 324 font-weight: bold; 316 margin-top: 0px;317 margin-bottom: 0px;325 margin-top: 0px; 326 margin-bottom: 0px; 318 327 } 319 328 … … 379 388 380 389 #bigBox { 381 width: 520px;382 padding: 10px;383 margin-left: auto;384 margin-right: auto;385 position: relative;386 border: 1px solid #444444;387 height: 275px;390 width: 520px; 391 padding: 10px; 392 margin-left: auto; 393 margin-right: auto; 394 position: relative; 395 border: 1px solid #444444; 396 height: 275px; 388 397 } 389 398 … … 453 462 background-color: #fafafa; 454 463 } 464 feedmelinks/submit-link.php
r1392 r1425 9 9 10 10 if( snuffed( $u )) { 11 log_mesg_to( " warning -- link attempt from snuffed user $u", "security" );11 log_mesg_to( "[link attempt] $u, " . get_ip(), "security" ); 12 12 return; 13 13 exit; … … 50 50 mysql_selectdb( getDBName() ); 51 51 if( $op == "submit" ) { 52 if( $debug ) {53 echo "DEBUG: \$u : $u<br />";54 echo "DEBUG: \$is_private : $is_private<br />";55 echo "<br />";56 }57 52 58 53 # link-spammers could forge isPrivate by hacking the form so re-check it: 59 if( ! $isPrivate ) 60 $isPrivate = link_exists( $url ) ? 1 : ""; 54 if( ! $isPrivate || $isPrivate == "NULL" ) 55 $isPrivate = link_exists( $url ) ? 1 : 0; 56 else 57 $isPrivate = 1; 58 61 59 # first we add the link and save the ID num: 62 $q = $newLinkID = addLinkSimple( $url, $name, $u, ($is_private != "" ? 1 : "NULL"), $debug );60 $q = $newLinkID = addLinkSimple( $url, $name, $u, $isPrivate, $from, $debug ); 63 61 if( $q ) { 64 62 65 log_mesg_to( "passing link_is_private = $is_private", "global" );66 63 67 64 # then add any new tags, and tag this link with th