Skip to content
This repository has been archived by the owner on Feb 7, 2018. It is now read-only.

Commit

Permalink
facebook counter: fix frontend/backend mismatch
Browse files Browse the repository at this point in the history
Frontend shows share button, backend queried like count.
  • Loading branch information
pmb0 committed Dec 1, 2014
1 parent 4f8668b commit df79a81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Heise/Shariff.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use Heise::Shariff::Cache;
use Mojo::Date;
use Mojo::Loader;

our $VERSION = '1.07';
our $VERSION = '1.08';

has service_namespaces => sub {['Heise::Shariff::Service']};

Expand Down
4 changes: 2 additions & 2 deletions lib/Heise/Shariff/Service/Facebook.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ sub request {

my $furl = Mojo::URL->new('https://api.facebook.com/method/fql.query');
$furl->query->param(format => 'json');
my $query = qq{select like_count from link_stat where url="$url"};
my $query = qq{select share_count from link_stat where url="$url"};
$furl->query->param(query => $query);

return [get => $furl];
}

sub extract_count {
my ($self, $res) = @_;
return $res->json->[0]->{like_count};
return $res->json->[0]->{share_count};
}

sub get_name {
Expand Down

0 comments on commit df79a81

Please sign in to comment.