Well , necessitate and you shall get . Kind lecturer K sent us his homebrew GSS generator written in PHP . It ’s a gripping art object of code using gamy - level algorithms and math to prove that the post distance and number of uppercase characters can be used to measure out the total insanity of any eBay post . Case in point :
Auction 1 – PLEASE HELP!WHAT ’S GROWING ON MY HEAD ! ! MYSTERY AUCTIONGSS Score : 66,731
Auction 2 – EXTRA LARGE HOBO BIG dark-green PURSE dish RING NEWGSS Score : 1,273

As we see , even if the poster tends to use upper-case letter letter , the GSS source is not dissipate .
The GSS Generator is uncommitted after the jump for further study . I surmise it might be slightly insecure and therefore would care a few pairs of eyes to ensure that we can indeed host this worthful tool on a host someday , thereby allow meg of men and women to separate the eBay wheat from the eBay insane people .
Related

eBay Deal of the solar day : Vampire Killing Kit
http://www.gizmodo.com/gadgets/gadgets/index.php#ebay-deal-of-the-day-vampire-killing-kit-114284
RUN AT YOUR OWN peril – I ’m not going to go through these to verify they do n’t “ rm -rf ” your boot dir .

“ ;
$ end_string = “ “ ;
//Find lead off and finish vendue dirt

$ beg_pos = strpos($buffer,$begin_string ) ;
$ end_pos = strpos($buffer,$end_string,$beg_pos ) ;
$ desc_text = substr($buffer,($beg_pos + strlen($begin_string)),($end_pos – $ beg_pos ) ) ;

//Strip out the tatter then peel out space
$ strip_text = strip_tags($desc_text ) ;
$ strip_text = str_replace ( ” “ , ” ” , $ strip_text ) ;

//Strip out line breaks and rejoinder ( proabbly do n’t need to do this )
$ strip_text = preg_replace(“/(rn|n|r)/ ” , “ ” , $ strip_text ) ;
//find lenght of stripped text

$ len_strip_text = strlen($strip_text ) ;
//Counter vars
$ num_lower = 0 ;

$ num_upper = 0 ;
$ num_other = 0 ;
//loop through pillage text enumeration upper , low and other chars

for($x = 0 ; $ x < $ len_strip_text ; $ x++ ) { $ test_char = substr($strip_text,$x,1 ) ; $ ascii_num = ord($test_char ) ; if ( ( $ ascii_num > = 97 ) & & ( $ ascii_num < = 122 ) ) { $ num_lower++ ; } else { if ( ( $ ascii_num > = 65 ) & & ( $ ascii_num < = 90 ) ) { $ num_upper++ ; } else { $ num_other++ ; } } } //Calculate Gizmodo Strangeness Score $ gss = ( $ len_strip_text - $ num_other ) * ( $ num_upper / $ num_lower ) ; echo " universal resource locator = $ url_to_calc “ ;
? >
Strangeness Score *

- ( Number Chars – Number Other Chars ) x ( Number Upper / Number Lower )
Stripped Text ( white space removed ): “ ;
echo $ strip_text ;

} else {
echo “ computer error fetching file ” ;
}

Here is an interesting command - line version in Perl by Thomas :
! /usr / bin / perl
practice LWP::Simple ;

{
if ( @ARGV[0 ] eq “ ” )
mark “ Usage : weirdness.pln ” ;
![]()
exit ;
$ url = @ARGV[0 ] ;
$ buffer zone = get “ $ uniform resource locator ” ;

$ buffer = ~ s/<(?:[^>‘”]|([‘”]).?1)*>//gs ;
$ length = length($buffer ) ;
@uppers = ( $ buffer = ~ /([A - Z])/g ) ;

@lowers = ( $ pilot = ~ /([a - z])/g ) ;
$ num_upper = @uppers ;
$ num_lower = @lowers ;
photographic print “ Non - hypertext mark-up language chars : $ lengthn ” ;
photographic print “ upper chars : $ num_uppern ” ;
mark “ scummy cleaning lady : $ num_lowernn ” ;
$ score = $ num_upper/$num_lower;$ratio = $ num_upper/$num_lower ;
$ score = $ ratio * $ duration ;
printf(“upper - to - lower ratio : % .2fn ” , $ proportion ) ;
printf(“Weirdness account : % .2fn ” , $ account ) ;
Hacks
Daily Newsletter
Get the best technical school , science , and culture word in your inbox daily .
news program from the future , delivered to your nowadays .