<s> import os , sys ; sys . path . insert ( <NUM_LIT:0> , os . path . join ( os . path . dirname ( __file__ ) , "<STR_LIT:..>" , "<STR_LIT:..>" ) ) <EOL> from pattern . web import Facebook , NEWS , COMMENTS , LIKES <EOL> from pattern . db import Datasheet , pprint , pd <EOL> try : <EOL> table = Datasheet . load ( pd ( "<STR_LIT>" ) ) <EOL> index = set ( table . columns [ <NUM_LIT:0> ] ) <EOL> except : <EOL> table = Datasheet ( ) <EOL> index = set ( ) <EOL> fb = Facebook ( ) <EOL> for status in fb . search ( "<STR_LIT>" , count = <NUM_LIT> , cached = False ) : <EOL> print "<STR_LIT:=>" * <NUM_LIT:100> <EOL> print status . id <EOL> print status . text <EOL> print status . author <EOL> print status . date <EOL> print status . likes <EOL> print status . comments <EOL> print <EOL> if len ( table ) == <NUM_LIT:0> or status . id not in index : <EOL> table . append ( [ status . id , status . text ] ) <EOL> index . add ( status . id ) <EOL> table . save ( pd ( "<STR_LIT>" ) ) <EOL> license = "<STR_LIT>" <EOL> if license != "<STR_LIT>" : <EOL> fb = Facebook ( license ) <EOL> me = fb . profile ( ) [ "<STR_LIT:id>" ] <EOL> for status in fb . search ( me , type = NEWS , count = <NUM_LIT:30> , cached = False ) : <EOL> print "<STR_LIT:->" * <NUM_LIT:100> <EOL> print status . id <EOL> print status . title <EOL> print status . text <EOL> print status . url <EOL> if status . comments > <NUM_LIT:0> : <EOL> print "<STR_LIT>" % status . comments <EOL> print [ ( x . author , x . text , x . likes ) for x in fb . search ( status . id , type = COMMENTS ) ] <EOL> if status . likes > <NUM_LIT:0> : <EOL> print "<STR_LIT>" % status . likes <EOL> print [ x . author for x in fb . search ( status . id , type = LIKES ) ] <EOL> print </s>
