OSDN Git Service

add db_search last post
authorISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
Thu, 18 Oct 2012 06:46:38 +0000 (15:46 +0900)
committerISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
Thu, 18 Oct 2012 06:46:38 +0000 (15:46 +0900)
mubot4fb.pl

index a2f2ce7..ebc0d00 100755 (executable)
@@ -139,6 +139,19 @@ sub _db_search {
        return $ret;
 }
 
+sub _db_search_lastpost {
+       my ($me, $who) = @_;
+
+       my $sth = $me->{dbh}->prepare('select * from posts where submitter = ? order by post_time desc limit 1');
+       $sth->bind_param(1, $who, SQL_VARCHAR);
+       $sth->execute();
+
+       my $ret = $sth->fetch_arrayref();
+       $sth->finish;
+
+       return $ret;
+}
+
 sub _fb_post_uri {
        my ($me, $post_id) = @_;
 
@@ -152,7 +165,6 @@ sub _fb_delete {
        $req->header('Content-Length', 0);
        my $resp;
        eval{$resp = LWP::UserAgent->new->request($req)};
-       warn $resp;
        return !$@;
 }