Changeset 1310

Show
Ignore:
Timestamp:
02/06/07 10:40:46 (2 years ago)
Author:
jm3
Message:

script tighening

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/bin/heuristics.sh

    r1308 r1310  
    4343USERS=$* 
    4444 
     45# db auth: 
     46u=fml_fml 
     47db=fml_fml 
     48p=fml 
     49 
    4550for USER in $USERS 
    4651do 
     
    4954        scope=10 
    5055 
    51    double_hyphenated_links=`mysql -u fml_fml -pfml fml_fml -B -e "select count( url ) as 'double_hyphenated_links' from links where submitter = '$USER' and url REGEXP '.+-.+-.+\\.com';" | tail -n1` 
    52 known_spammer_domain_links=`mysql -u fml_fml -pfml fml_fml -B -e "select count( url ) as 'blogspot_links' from links where submitter = '$USER' and url REGEXP 'blogspot\.com';" | tail -n1` 
    53                 dot_info_domains=`mysql -u fml_fml -pfml fml_fml -B -e "select count( url ) as 'dot_info_domains' from links where submitter = '$USER' and url REGEXP '\\.info(%2F|$)';" | tail -n1` 
    54                    tags_w_commas=`mysql -u fml_fml -pfml fml_fml -B -e "select count( name ) as 'tags_w_commas' from linksGroups where userid = '$USER' and name REGEXP ',';" | tail -n1` 
    55     tags_w_multiple_spaces=`mysql -u fml_fml -pfml fml_fml -B -e "select count( name ) as 'tags_w_multiple_spaces' from linksGroups where userid = '$USER' and name REGEXP '. . ';" | tail -n1` 
    56                      links=`mysql -u fml_fml -pfml fml_fml -B -e "select count( url ) as 'links' from links where submitter = '$USER';" | tail -n1` 
    57                             tags=`mysql -u fml_fml -pfml fml_fml -B -e "select count( id ) as 'tags' from linksGroups where userid = '$USER';" | tail -n1` 
    58    last_ten_domains_linked=`mysql -u fml_fml -pfml fml_fml -B -e "select lower(substring_index(url, '.', 2)) from links where submitter = '$USER' order by id desc limit ${scope};" | tail -n${scope}` 
     56   double_hyphenated_links=`mysql -u $u -p$p $u -B -e "select count( url ) as 'double_hyphenated_links' from links where submitter = '$USER' and url REGEXP '.+-.+-.+\\.com';" | tail -n1` 
     57known_spammer_domain_links=`mysql -u $u -p$p $u -B -e "select count( url ) as 'known_spammer_domain_links' from links where submitter = '$USER' and url REGEXP '(ourbigtop|blogspot)\.com';" | tail -n1` 
     58                dot_info_domains=`mysql -u $u -p$p $u -B -e "select count( url ) as 'dot_info_domains' from links where submitter = '$USER' and url REGEXP '\\.info(%2F|$)';" | tail -n1` 
     59                   tags_w_commas=`mysql -u $u -p$p $u -B -e "select count( name ) as 'tags_w_commas' from linksGroups where userid = '$USER' and name REGEXP ',';" | tail -n1` 
     60    tags_w_multiple_spaces=`mysql -u $u -p$p $u -B -e "select count( name ) as 'tags_w_multiple_spaces' from linksGroups where userid = '$USER' and name REGEXP '. . ';" | tail -n1` 
     61                     links=`mysql -u $u -p$p $u -B -e "select count( url ) as 'links' from links where submitter = '$USER';" | tail -n1` 
     62                            tags=`mysql -u $u -p$p $u -B -e "select count( id ) as 'tags' from linksGroups where userid = '$USER';" | tail -n1` 
     63   last_ten_domains_linked=`mysql -u $u -p$p $u -B -e "select lower(substring_index(url, '.', 2)) from links where submitter = '$USER' order by id desc limit ${scope};" | tail -n${scope}` 
     64          has_been_snuffed=`mysql -u $u -p$p $u -B -e "select snuffed from linksUsers where userid = '$USER';" | tail -n1` 
    5965      # for freshness idx: 
    60                 first_link=`mysql -u fml_fml -pfml fml_fml -B -e "select to_days( createDate ) from links where submitter = '$USER' ORDER BY id ASC LIMIT 1;" | tail -n1` 
    61                        last_link=`mysql -u fml_fml -pfml fml_fml -B -e "select to_days( createDate ) from links where submitter = '$USER' ORDER BY id DESC LIMIT 1;" | tail -n1` 
     66                first_link=`mysql -u $u -p$p $u -B -e "select to_days( createDate ) from links where submitter = '$USER' ORDER BY id ASC LIMIT 1;" | tail -n1` 
     67                       last_link=`mysql -u $u -p$p $u -B -e "select to_days( createDate ) from links where submitter = '$USER' ORDER BY id DESC LIMIT 1;" | tail -n1` 
    6268 
    6369        if [ $links -ne 0 ] 
     
    94100                volume_idx=`echo "scale = 4; 1-($links / $pheezys_links)" | bc` 
    95101                output_xml_idx "volume_idx" $volume_idx 
     102                 
     103                if [ -z "$has_been_snuffed" -o "$has_been_snuffed" = "NULL" ] 
     104                then 
     105                        has_been_snuffed=0 
     106                fi 
     107                output_xml_idx "has_been_snuffed_idx" $has_been_snuffed 
    96108 
    97109                if [ $tags -ne 0 ]