Changeset 1425

Show
Ignore:
Timestamp:
03/16/07 10:17:44 (2 years ago)
Author:
jm3
Message:

gulp. svn diff for the deltas

Files:

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
  • feedmelinks/.cvsignore

    r1406 r1425  
    2929xfer 
    3030_backups 
     31.cpan 
  • feedmelinks/.htaccess-global

    r1413 r1425  
    2020RewriteRule    ^register /login?op=inputNewAccount [L] 
    2121 
    22 # secret about page 
     22# meta info 
     23RewriteRule    ^misc/ChangeLog          http://toolstomaketools.svnrepository.com/codepot/trac.cgi/log/feedmelinks [L] 
    2324RewriteRule    ^1$ /misc/secret-about.php 
    2425 
     
    4647RewriteRule    ^recategorize/([0-9]+)/d$ /categorize?op=change&id=$1&debug=1 [L] 
    4748 
     49# peeps 
    4850RewriteRule    ^peeps/?$ /contacts/index [L] 
    4951 
    5052# 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/comment 
    57 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] 
     53RewriteRule    ^xml/authenticate(.*)$         /authenticate$1 [L] 
     54RewriteRule    ^xml/(f|tag)/(.+)$             /folder-as-xml?folder=$2 [L] 
     55RewriteRule    ^api/tag/(.+)$                 /folder-as-xml?folder=$1 [L] 
     56RewriteRule    ^(xml|api)/tags$               /tags-as-xml [L] 
     57RewriteRule    ^(xml|api)/user/([0-9a-z]+)$   /users-links-as-xml?user=$2 [L] 
     58RewriteRule    ^xml/set/comment               /api/comment 
     59RewriteRule    ^(xml|api)/peeps$              /peeps-as-xml [L] 
     60RewriteRule    ^(xml|api)/recent$             /api/recent-as-xml.php [L] 
     61RewriteRule    ^(xml|api)/recent/(.+)$        /api/recent-as-xml.php?user=$2 [L]  
     62RewriteRule    ^api/backroom/(.*)$            /api/restricted/secure-call.php?call=$1 [L] 
    6163 
    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] 
     64RewriteRule    ^api/rename/(.*)$              /api/core/index.php?op=rename&user=$1 [L] 
     65RewriteRule    ^api/add_tags/(.*)$            /api/core/index.php?op=add_tags&user=$1 [L] 
     66RewriteRule    ^api/search(.*)$               /search-as-xml.php$1 [L] 
    6567 
    6668# JSON API 
  • feedmelinks/FAQ/index.php

    r1390 r1425  
    4646                        <li><a href="#q6_0">What is the naming convention / url schema for Feed Me Links? </a></li> 
    4747                        <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> 
    4949                        <li><a href="#developers">Programming Feed Me Links - Developer Sandbox</a></li> 
    5050 
     
    297297                <div class="q">Can I add links via email?</div> 
    298298                <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 
    301306                        Send emails from your mail program (or script) to "add&nbsp;@&nbsp;feedmelinks&nbsp;.&nbsp;com" (no spaces) 
    302307                        <p/> 
     
    396401        <div> 
    397402                <a name="apis"></a> 
     403                <a name="api"></a> 
     404                <a name="API"></a> 
    398405                <div class="q">Programming Feed Me Links - The Feed Me Links API</div> 
    399406                <div class="a"> 
     
    408415 
    409416                        <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 /> 
    411426                        <br /> 
    412427                         
  • feedmelinks/admin/disable-user.php

    r1352 r1425  
    1111                $result = disable_user( $user ); 
    1212        else if( $op == "re_enable" ) 
    13                 $result = re_enable_user($user); 
     13                $result = re_enable_user( $user, $manual = true ); 
    1414        else if( $op == "notify_expiring_soon" ) 
    1515                $result = notify_expiring_soon($user); 
     16 
     17                echo h1($op . "ing $user"); 
    1618 
    1719        if( $result ) { 
     
    3032<form method="post"> 
    3133        <select name="op"> 
     34                <option value="re_enable">re-enable</option> 
     35                <option value="disable">disable</option> 
    3236                <option value="expire">expire</option> 
    33                 <option value="disable">disable</option> 
    34                 <option value="re_enable">re-enable</option> 
    3537                <option value="notify_expiring_soon">warn they are about to expire</option> 
    3638        </select> 
  • feedmelinks/aim/bot/klaus.pl

    r1402 r1425  
    22use strict; 
    33use Module::Reload; 
    4 use Net::OSCAR qw(:standard); 
     4use Net::OSCAR qw(:standard :loglevels); 
    55use Data::Dumper; 
    66use FeedMeLinks::Environment; 
     
    1212my $aimbot = Net::OSCAR->new(capabilities => [qw(buddy_icons typing_status)]); 
    1313 
    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);  
     16print FeedMeLinks::Environment::get_aim_bot_user() . "\n"; 
     17print FeedMeLinks::Environment::get_aim_bot_password() . "\n";;  
     18$aimbot->signon( FeedMeLinks::Environment::get_aim_bot_user(), FeedMeLinks::Environment::get_aim_bot_password() );  
    1619 
     20# doesn't work 
    1721#open( ICON, "48x48heart.gif" ) || die("can't open icon file: $!"); 
    1822#binmode( ICON ); 
     
    2832sub respond { 
    2933        my ($aim, $sender, $message, $away) = @_; 
     34         
     35        print "respond called\n"; 
    3036 
    3137        # 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  
    2828my $tagName = "new"; 
    2929 
    30 open(LOG, ">>" . get_webserver_root() . "/_logs/mail.log") or die "can't open file"; 
     30open(LOG, ">>" . FeedMeLinks::Environment::get_webserver_root() . "/_logs/mail.log") or die "can't open file"; 
    3131print LOG "--- starting run ---\n" if( $verbose ); 
    3232 
     
    7878if( $headersDone && $title && $submitter && $link ) { 
    7979        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() ); 
    8282 
    8383        if( ! $dbh ) { 
     
    8686        } 
    8787 
    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"; 
    8989        my $sth = $dbh->prepare( $qs ); 
    9090 
     
    111111                        print LOG "$now [link-by-mail] $dbUser added $linkID\n"; 
    112112 
    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"; 
    114114                        $sth = $dbh->prepare( $qs ); 
    115115                        $sth->execute( $tagName, $dbUser ); 
     
    118118                        if( ! $tagID ) { 
    119119                                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)"; 
    121121                                print LOG "SQL: $qs with $dbUser, $tagName\n" if( $verbose ); 
    122122                                $sth = $dbh->prepare( $qs ); 
     
    136136                        if( $tagID ) { 
    137137                                print LOG "found existing tag as ID $tagID\n" if( $verbose ); 
    138                                 $qs = "INSERT INTO linksCategoriesXRef VALUES( ?, ?)"; 
     138                                $qs = "INSERT INTO links_tags_xref VALUES( ?, ?)"; 
    139139                                $sth = $dbh->prepare( $qs ); 
    140140                                $sth->execute( $linkID, $tagID ); 
     
    163163print LOG "--- ending run ---\n\n" if( $verbose ); 
    164164close(LOG); 
    165  
    166 From root@raptor.webhostserver.biz Thu Mar 08 13:20:49 2007 
    167 Return-path: <root@raptor.webhostserver.biz> 
    168 Envelope-to: add@feedmelinks.com 
    169 Delivery-date: Thu, 08 Mar 2007 13:20:49 -0700 
    170 Received: from fml by raptor.webhostserver.biz with local-bsmtp (Exim 4.63) 
    171         (envelope-from <root@raptor.webhostserver.biz>) 
    172         id 1HPP6P-0007Ie-RH 
    173         for add@feedmelinks.com; Thu, 08 Mar 2007 13:20:45 -0700 
    174 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on 
    175         raptor.webhostserver.biz 
    176 X-Spam-Level:  
    177 X-Spam-Status: No, score=-0.0 required=5.0 tests=NO_RELAYS autolearn=ham 
    178         version=3.1.8 
    179 Received: from root by raptor.webhostserver.biz with local (Exim 4.63) 
    180         (envelope-from <root@raptor.webhostserver.biz>) 
    181         id 1HPP6O-0007IO-ND 
    182         for add@feedmelinks.com; Thu, 08 Mar 2007 13:20:41 -0700 
    183 To: add@feedmelinks.com 
    184 Subject: test 
    185 Message-Id: <E1HPP6O-0007IO-ND@raptor.webhostserver.biz> 
    186 From: root <root@raptor.webhostserver.biz> 
    187 Date: Thu, 08 Mar 2007 13:20:40 -0700 
    188  
    189 test support 
    190  
  • feedmelinks/bin/hybrid-to-xml.pl

    r1375 r1425  
    11#!/usr/local/bin/perl 
     2 
     3# convert from the delicious hybrid export format to valid XML 
    24 
    35my $d = $ARGV[0]; 
  • feedmelinks/categorize.php

    r1360 r1425  
    176176 
    177177<div style="border-bottom: 1px solid #dddddd; margin-bottom: 1px; padding: 0px;"> 
     178 
    178179        <table border="0" cellspacing="0" cellpadding="0"> 
    179180                <tr> 
    180181                        <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 ) ?>">  
    182186<?php 
    183187                                if( $debug ) { 
     
    195199                                        if( link_exists( $url )) { 
    196200                                ?> 
    197                                 <input type="hidden" name="is_private" value="checked" /> 
     201                                <input type="hidden" name="isPrivate" value="checked" /> 
    198202                                <?php 
    199203                                        # otherwise the user can choose 
     
    202206                                <br /> 
    203207                                <a href="javascript:setPrivate();">Save as private</a>? 
    204                                 <input type="checkbox" name="is_private" /> 
     208                                <input type="checkbox" name="isPrivate" /> 
    205209                                <br /> 
    206210                                <?php 
  • feedmelinks/import/processing.php

    r1375 r1425  
    5050                                        $comment = $x[1]; 
    5151 
    52                                         $inserted_id = addLinkSimple( $url, $name, $user, 1 ); 
     52                                        $inserted_id = addLinkSimple( $url, $name, $user, $isPrivate = 1, $from = "import" ); 
    5353 
    5454                                        if( !$inserted_id ) { 
  • feedmelinks/import/ready-to-import.php

    r1422 r1425  
    6060                                        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" ); 
    6161                                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" ); 
    6363 
    6464                                #tell( "Debugging Check:", "We found " . $ls . " links and " . $ts . " tags, which is allowed. Proceeding." ); 
  • feedmelinks/invite/index.php

    r1408 r1425  
    3737 
    3838        function get_invite_boilerplate( $user ) { 
    39                 return "Feed Me Links just launched a new AIM app for savinv your 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. 
     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. 
    4040 
    4141To start playing around, just click http://feedmelinks.com/aim/hello 
    42  
    43 Peace! 
    4442 
    4543-- 
     
    5250?> 
    5351 
     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 
    5469<form name="invite_form"> 
    5570        <input type="hidden" name="op" value="send" /> 
    5671 
     72        <h1 style="margin-left: 2.0em;"> 
     73                Invite your peeps to join the AIM orgy! 
     74        </h1> 
     75 
    5776        <div id="fake_email"> 
    58                 <h1> 
    59                         Invite your peeps to AIM 
    60                 </h1> 
    61  
    6277                <p style="font-family: sans-serif;"> 
    6378 
    6479                        <p> 
    65                                 <b>From</b>: <?= $u ?> &lt;<?= getEmailAddressForUser( $u ) ?>&gt; 
     80                                <big><b>From</b></big>: <?= $u ?> &lt;<?= getEmailAddressForUser( $u ) ?>&gt; 
    6681                        </p> 
    6782 
    68                        <p> 
    69                                <b>To</b>: <?= $peeps ?><br /> 
     83                <p> 
     84                        <big><b>To</b></big>: <?= $peeps ?><br /> 
    7085                        </p> 
    7186                        <p> 
    72                                 <b>Subject</b>: <?= get_invite_sub( $u ) ?><br /> 
     87                                <big><b>Subject</b></big>: <?= get_invite_sub( $u ) ?><br /> 
    7388                        </p> 
    7489                        <br /> 
     
    7893                                        Hi! 
    7994                                </p> 
     95                                <div id="fake_email_note"> 
     96                                ( Your message here: ) 
     97                                </div> 
    8098 
    8199                                <textarea name="user_message" rows="5" cols="60"></textarea> 
  • feedmelinks/lib/FeedMeLinks/Bot.pm

    r1401 r1425  
    1515 
    1616my $logfile = FeedMeLinks::Environment::get_webserver_root() . "/_logs/aim.log"; 
    17 print "opening $logfile\n"; 
    1817open(LOG, ">>" . $logfile) or die "can't open log $logfile"; 
    1918 
     
    2322        select $ofh; 
    2423} 
    25 log_mesg( \*LOG, "starting run" ); 
    2624 
    2725my $num_recent = 5; 
    28 my $www = get_proxy( FeedMeLinks::Environment::get_bot_user(), FeedMeLinks::Environment::get_bot_password()); 
     26my $www = get_proxy( FeedMeLinks::Environment::get_bot_puppetmaster_user(), FeedMeLinks::Environment::get_bot_puppetmaster_password()); 
    2927my $site = "http://www." . FeedMeLinks::Environment::get_domain(); 
    3028 
     
    8482                                # set our session state 
    8583                                $sessions_ref->{$sender}->{"last_link"} = $link_id; 
     84                                $sessions_ref->{$sender}->{"last_name"} = $name; 
    8685                                $sessions_ref->{$sender}->{"last_action"} = "added_link"; 
    8786                                $sessions_ref->{$sender}->{"added_tags"} = 0; 
     
    164163 
    165164        # COMMAND: PEEPS ############################################################### 
    166         } elsif( $fml_username && $message =~ m/peeps/ ) { 
     165        } elsif( $fml_username && $message =~ m/^\s*peeps\s*$/ ) { 
    167166                $aim->send_im($sender, "Look at you, you have <a href='$site/peeps'>" . ( keys %{$sessions_ref->{$sender}->{"peeps"}} ) . " peeps</a>!" ); 
    168167                 
     
    182181         
    183182        # 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*$/ ) { 
    185184                log_mesg( \*LOG, "help", " $sender" ); 
    186185 
     
    193192                log_mesg( \*LOG, "status", " $sender" ); 
    194193                $aim->send_im($sender, "<b>DEBUG DUMP</b>:\nsender: $sender\nmessage: $message" ); 
    195                 print Dumper( $sessions_ref ) . "\n"; 
    196194         
    197195        # COMMAND: CREDITS ############################################################### 
     
    220218                        if( $response_code == "success" ) { 
    221219                                $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; 
    222221                                if( $sessions_ref->{$sender}->{"added_tags"} == 0 ) { 
    223222                                        $aim->send_im($sender, h(get_message( "add_tags"))); 
     
    229228         
    230229        # 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*$/ ) { 
    232231 
    233232                        # cache anyone who we CAN share with in the session, first 
     
    252251                                . " peeps</a>, " 
    253252                                . ( 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 
    264275  
    265276        # COMMAND: TAG ############################################################### 
     
    322333                        log_mesg( \*LOG, "debug", "summary: $summary" ); 
    323334                $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" )); 
    325336                } 
    326337 
    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} ) { 
    329340                my $peep = encode( $message ); 
    330341                $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                        } 
    331357 
    332358        } else { 
     
    347373                        log_mesg( \*LOG, "debug", " $url" ); 
    348374 
    349                         if( 1 ) { 
    350                         # FIXME EMERGENCY: if( $sessions_ref && $sessions_ref->{$sender} && $sessions_ref->{$sender}->{"proxy"}) { 
    351375                        my $response = $www->get( $url, []); 
    352376                        my $nodes = XML::XPath->new(xml => $response->content)->findnodes("/rest/response/link"); 
     
    354378                        my $response_code = "" . XML::XPath->new(xml => $response->content)->findnodes("/rest/response/\@code"); 
    355379                        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 ); 
    371381                                log_mesg( \*LOG, "search", "found $message" ); 
    372382                                if( length( $summary ) > 3 ) { 
     
    377387                                } 
    378388                } 
    379                 } 
    380389        } 
    381390 
     
    385394# END MAIN ZZZZZZZZ HERE COME THOSE FORM-FEEDS! 
    386395 
     396sub sent_message { 
     397        my( $aim, $to, $mesg_id) = @_; 
     398        log_mesg( \*LOG, "debug", "message to $to went thru ($mesg_id)"); 
     399} 
     400 
     401sub 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} 
    387420 
    388421sub get_printable_user_string_from_hash { 
  • feedmelinks/login.php

    r1393 r1425  
    166166 
    167167                                                        $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? 
    170173 
    171174                                                        $authenticated = 1; 
  • feedmelinks/script/funcs.js

    r1381 r1425  
    1313 
    1414function 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); 
    1616        //return true; 
    1717} 
  • feedmelinks/style/main.css

    r1409 r1425  
    8181.folder_row {} 
    8282.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; 
    8787} 
    8888 
    8989.right_justified_num_column {} 
    9090.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; 
    9595} 
    9696 
    9797.fr > .l { 
    98   float: left; 
     98       float: left; 
    9999} 
    100100 
    101101.fr > .r { 
    102   float: right; 
    103   width: 60px; 
     102       float: right; 
     103       width: 60px; 
    104104} 
    105105 
     
    121121 
    122122.tagcloud > a, .tagcloud > a:visited { 
    123   color: #FF6600; 
     123       color: #FF6600; 
    124124} 
    125125 
     
    130130 
    131131a.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 
     140a.forcehot:hover { 
     141        text-decoration: none; 
    133142} 
    134143 
     
    140149a.underhot:active, .underhot:active, a.underhot:hover, .underhot:hover { 
    141150        border-bottom: 1px dotted black; 
    142   color: black; 
     151       color: black; 
    143152        text-decoration: none; 
    144153} 
     
    314323        font-family: verdana, sans-serif; 
    315324        font-weight: bold; 
    316   margin-top: 0px; 
    317   margin-bottom: 0px; 
     325       margin-top: 0px; 
     326       margin-bottom: 0px; 
    318327} 
    319328 
     
    379388 
    380389#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; 
    388397} 
    389398 
     
    453462        background-color: #fafafa; 
    454463} 
     464 
  • feedmelinks/submit-link.php

    r1392 r1425  
    99 
    1010        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" ); 
    1212                return; 
    1313                exit; 
     
    5050                        mysql_selectdb( getDBName() ); 
    5151                        if( $op == "submit" ) { 
    52                         if( $debug ) { 
    53                                 echo "DEBUG: \$u : $u<br />"; 
    54                                 echo "DEBUG: \$is_private : $is_private<br />"; 
    55                                 echo "<br />"; 
    56                         } 
    5752 
    5853                        # 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 
    6159                        # 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 ); 
    6361                        if( $q ) { 
    6462 
    65                         log_mesg_to( "passing link_is_private = $is_private", "global" ); 
    6663 
    6764                                # then add any new tags, and tag this link with th