Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook like button resetting to 0 continuosly #88

Open
mardet opened this issue Apr 27, 2014 · 5 comments
Open

Facebook like button resetting to 0 continuosly #88

mardet opened this issue Apr 27, 2014 · 5 comments

Comments

@mardet
Copy link

mardet commented Apr 27, 2014

You can see the problem in this url:
http://brooklyn.lodgify.com

It shows 0 while it should be 1. This problem started a week ago, it was working before with the same code.

There are more details in stackoverflow if you want to contribute the answer there:
http://stackoverflow.com/questions/23323678/facebook-like-always-reset-to-0

Thanks!

@GwendolenLynch
Copy link
Contributor

@Durden81 does your initial HTML look something like this:

<div class="social-buttons cf">
    <a
        href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fbrooklyn.lodgify.com"
        class="socialite facebook-like"
        data-href="http://brooklyn.lodgify.com"
        data-send="false"
        data-action="like"
        data-layout="standard"
        rel="nofollow" target="_blank">
           <span class="vhidden">Like on Facebook</span>
    </a>
</div>

Emphasis on the sharer.php part in the href...

@mardet
Copy link
Author

mardet commented Apr 27, 2014

@GawainLynch thanks for replying.
I have changed the HTML to be more similar to the one you provided:

 <div class="facebook">
        <a class="socialite facebook-like" rel="nofollow" target="_blank" href="http://www.facebook.com/sharer.php?u=http%3a%2f%2fbrooklyn.lodgify.com" 
data-href="http://brooklyn.lodgify.com" data-send="false" data-layout="button_count" data-width="135" data-show-faces="false">Facebook Like</a>
    </div>

but still doesn't work..
any other idea?

@GwendolenLynch
Copy link
Contributor

Hmmm... The major difference I'm seeing in what we each posted is the classes on the wrapper div:

<div class="social-buttons cf">

I have put that URL into my staging site (hardcoded) and I get 1 like which matches the JSON I get back from Faceplant's API:
https://api.facebook.com/method/fql.query?query=select%20%20like_count%20from%20link_stat%20where%20url=%22http://brooklyn.lodgify.com%22

@mardet
Copy link
Author

mardet commented Apr 28, 2014

I found the problem... in the end it was a problem with the fact that the page that was receiving the likes returned a 301 and not a 200. (no matter what is stated data-href the page being liked needs to give a 200 or facebook will give back 0 likes.)
We changed the url once in our application and so we lost those likes.
So in the end the problem wasn't with the socialite plugin.
Thank you for your help!

@GwendolenLynch
Copy link
Contributor

Excellent! No problems for lending a hand, that is what open source is all about :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants