Like button data-href with IP address - facebook-like

We're struggling to get Like button working and we think it's because the use of an IP address rather than a domain name on data-href property. Is it true??
<div class="fb-like" data-href="http://74.125.234.146" data-send="true" data-width="450" data-show-faces="false">
</div>
Once set the data-href property with a domain name it works pretty well.
Thanks in advance!

I know that this is an old question, but I had this problem as well, and the solution is that facebook won't work together with IP address, only with a webpage with DNS or with a valid data-href (like http://example.com)

I would say, given the research I have done, that there is no reason why it should not work.
Source: https://developers.facebook.com/docs/reference/plugins/like/
However, given that it did not work for you in your tests, I would say there is no official restriction (that I could find), but it is not recommended (for recommendation's sake).

Related

How to get Facebook Page ID from Page URL

I need to get the Page ID from the Page URL. This is NOT from inside a page tab, that's easy. This is similar to what is being done here: http://findmyfbid.com
Any help would be appreciated as I have been searching for over an hour! Bonus points for showing how to do this in classic ASP. I have no issue getting signed requests & parsing them, the URL to ID portion is what is throwing me.
thanks :)
As noted above in 1st answer commments, that does work, but it's not the data that we want since it's an external url. THIS is the correct way to do it:
https://graph.facebook.com/v2.5/cocacola?access_token=[yourtoken]
OR
This works too:
https://graph.facebook.com/v2.5/https://www.facebook.com/cocacola?access_token=[yourtoken]
This is the way to do it: https://developers.facebook.com/docs/graph-api/reference/v2.0/url
if you are using a GET request, be sure to append access_token=appid|appsecret to the URL you are requesting and it will work.
Thanks for the tip to point me in the correct direction Alex!

Default Site Collection

My sharepoint site has only one site collection.
When accessed the default URL http://example.com it takes to http://example.com/_layouts/15/start.aspx#/default.aspx
Instead i want it to go to http://example.com/sites/siteCollection1/_layouts/15/start.aspx#/SitePages/Home.aspx
I have been googling for a long time and found no simple solution.
Sounds like you need to use a host header. This is from 2010, but concepts are the same:
http://www.mssharepointtips.com/tip.asp?id=929
Have you tried Site Settings > Look and Feel > Welcome page and then entering the page you want in there?

How does no nojsstats.appspot.com work?

I'm curious about: http://nojsstats.appspot.com
This service is meant for google-analytics users that want to track their pageviews and others things even if javascript is disabled.
I wonder how this service works and how it can determine the necessary data without javascript? I mean what is happening when I HTTP-GET to the site:
Example (HTML code):
<img src="http://nojsstats.appspot.com/UA-123456/mywebsite.com" />
Follow the link, you will see what it does.
The Example you gave is basically a short code for:
http://www.google-analytics.com/__utm.gif?utmwv=1&utmn=93757836&utmsr=-&utmsc=-&utmul=-&utmje=0&utmfl=-&utmdt=-&utmhn=mywebsite.com&utmr=&utmp=&utmac=UA-123456........

How can I write a regex to match everything but a char?

I've switched in my wordpress blog from urls like this:
/blog/2012/01/01/how-to-build-a-website
To shorter urls like this
/blog/?p=123
Wordpress has a search engine who works like this
/blog/search/?s=how to build a website
And search for the s params.
I'm trying to use .htaccess Redirectmatch to redirect all the old urls to the search url with the title of the post as the s params.
So if the user serf to
/blog/2012/01/01/how-to-build-a-website
should be redirect to
/blog/search/?s=how to build a website
I've coded this
Redirectmatch blog/\d+/\d+/\d+/(.+) http://www.mysite.com/blog/?s=$1
But this regex grap the whole string after the last / within the - symbol inside it.
In this way if a user serf to
/blog/2012/01/01/how-to-build-a-website
Will be redirected to
/blog/search/?s=how-to-build-a-website
while I want the user redireced to
/blog/search/?s=how to build a website
How can I write the regex to do this?
EDIT:
Yes guys, I know that this kind of urls are ugly :) But I just would know how to do it, because behind this there are some technical issues I'm trying to solve..
Please don't do this. I know it can seem tempting to go for short URLs; after all, you get things like TinyURL and such. Isn't it better to have /blog/?p=123 than /blog/2012/01/01/how-to-build-a-website?
No. It's not.
The reason is because when someone posts a link to your blog article, the longer URL means something. It tells the person how old the article is. It gives the title. It helps people find your article; after all, the URL is given a lot of weight by Google when indexing your site.
URLs used to be built for computers. Something like /blog/?p=123 is perfect for computers; it's easy to parse, it doesn't require any extra database lookups. You can write two articles named "How to Build a Website" and the blog engine doesn't have to make sure it adds a -2 on the second one. It maps easily to the actual structure of files on the server, without making up structure in the URL.
But we've realized since that URLs can be built for humans, too. The URL /blog/2012/01/01/how-to-build-a-website has a form that can be easily understood by humans. Sure, it's a bit longer to type, but all the bits you're typing are easier, and most URLs are copy'n'pasted anyway or just clicked on. It's more work for the computer, sure, but it's worth it. It makes the Internet friendlier.
So I'm sorry, but I won't help you. :)

Django current location bar

I would like to "current location bar" id Django. Something like on eBay under the "Women clothing" (eBay>Fashion>Women's Clothing), but I don't really know how to do it.
I was wondering if I should use request.get_full_path() or something like that, but it seems very dirty to me.
Thanks in advance,
Adam
What you're looking for is called "breadcrumbs" and you can find a nice snippet here
As said there:
The URL
/users/foo/config/
will get to these breadcrumbs:
Users>>foo>>Config
which is basically the correct way to understand this snippet!
Hope it helps
you're wanting the full breadcrumb trail?
Usually you just use django's url template tag: https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#url and reverse each known url for where you are on the site.