Google Plus API Share URL functionality removes hash fragments from URLs - api

I am trying to share the following URL via the Google Plus API
http://www.w3.org/TR/WD-html40-970708/htmlweb.html#h-4.1.1
I am using the following URL to share that:
https://plus.google.com/share?url=http://www.w3.org/TR/WD-html40-970708/htmlweb.html#h-4.1.1
However, the fragment is being removed, so I am only able to share the following
http://www.w3.org/TR/WD-html40-970708/htmlweb.html
The documentation doesn't mention anything regarding constraints about hash fragments.
Has anyone already faced this issue before?
Thanks

duh
Use %23 to encode #.
I thought I had already tested this.

Related

Google Maps Api Key Custom Referrers Syntax

I'm trying to get this to work for my site, but I have a unique problem with syntax that I am not been able to find an answer for it yet.
For example:
www.mysite.dev.team.com (www.mysite.com is the site url)
What I need is basically the dev to be dynamic and open to any number after it so basically it could be dev7, dev8, dev9
How would I write this into the referrers api section in the Google Api Referrers list?
*.mysite.*.team.com/*
*.mysite*.com/*
I've tried multiple different combinations but nothing worked
Thanks
Found a solution!
*.team.com/*
fixed the problem

Google SEO Extension URL Trick

I have recently launched a website & therefore trying to figure out the Seo tricks to make it more visible. I use prerender.io to render javascript.
Can you please tell me how to show extended url results besides the main website link? Is there anything specific i need to do to get the results in the particular format?
For Example : Here main url is Google Voice & rest extended urls.
Well , There is no rules for this structure. Often, my old sites got structured but not the new one.
Google have their own theory for make this structure.

Sharing a link (share?url=) with spaces?

Trying to add a sharing function to my site, but GPlus seems to have trouble sharing url's with spaces in them.
Even escaped they dont seem to work.
eg;
https://plus.google.com/share?url=http://www.google.com/%23test%20test
It only seems to recognize upto before the %20.
Any ideas? Is this a bug? Am I doing something wrong?
The site is rather ajaxy, and in the history tokens would be a pain to need to use non-standard escaping of characters just for google plus.
I don't think that this is a bug with Google+ but rather its likely intentional because those URLs would need to be double URL encoded because one URL is sharing a second URL, thus your shared URL should be http%3A%2F%2Fwww.google.com%2F%2523test%2Btest
This won't work to create a preview in the share snippet but the URL is correct when it is shared.
All said, you shouldn't use spaces in your URLs because they are considered unsafe, see RFC 1738. You should change your app's URL structure.

How to load a static google map with a path (polyline)?

I have implemented some code that loads an image from a URL upon a listview item being clicked; this has been tested with a 'dummy' image and works without any problem with the image being displayed in an imageview object.
However, what I really want to do is to load a Static Google Map with Paths (polyline) via URL, but for some reason this is not working and I hope that someone here will be able to tell me what is wrong with my URL:
http://maps.googleapis.com/maps/api/staticmap?size=400x400&path=40.737102,-73.990318|40.749825,-73.987963|40.752946,-73.987384|40.755823,-73.986397
According to the Google documentation http://code.google.com/apis/maps/documentation/staticmaps/ I believe that my URL should work, because an image witha path only requires the size attribute (i.e. all others are optional).
When I try to test load my URL via a web-browser I receive an Error 403 in Google Chrome telling me that the googleapis website requires a log in. Is this the API key? I have an API key that I've previously used for a non-static google map and I copy/pasted this key from the map's xml into my URL (using the key= attribute), but again this was not successful.
I've tried searching on google and this forum, but it seems that no-one has had this problem before - or maybe I'm just really bad at searching :( But hopefully someone can assist?
Thanks!
You're missing the required sensor parameter.
http://maps.googleapis.com/maps/api/staticmap?size=400x400&path=40.737102,-73.990318|40.749825,-73.987963|40.752946,-73.987384|40.755823,-73.986397&sensor=false
This requirement is fairly new, but yes, you are missing the API key.
Just as you added the parameters &size= or &path=, at some point you need to have a &key=parameter. So for your example it would look like this:
http://maps.googleapis.com/maps/api/staticmap?size=400x400&key=ENTER-YOUR-API-KEY&path=40.737102,-73.990318|40.749825,-73.987963|40.752946,-73.987384|40.755823,-73.986397
hope that helps

Using Google maps API via SSL

So, I know just recently that google maps API is now available in SSL (here).
My question is, how do I retro-fit my http google maps api script to use this?
So my http Google maps API script call looks like this:
http://maps.google.com/maps?file=api&v=3&sensor=false&key=########
They suggest via this link that to use SSL it should be this:
https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false
I've tried retro-fitting this into my old URL format like so:
https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false&key=########
but that no longer displays the map.
Does anyone have any suggestions on what the URL should be?
Thanks
Try this line:
https://maps.google.com/maps/api/js?v=3.5&sensor=true
Google btw suggests that you explicitly enter what version of the api you are going to use. Just entering v=3 will always return the latest version, at the moment 3.5. I believe that the current stable version is 3.3.
As Trott wrote in his answer, api key is no longer needed.
You don't need an API key to use v3, but I suppose it probably doesn't hurt. General things to try:
Open your browser's JavaScript console and see if it is reporting any problems when you load the page.
Remove the API key
Change & to just &
Copy and paste the exact link text you put above into your code, because that link text is working for me. I'm referring to this:
https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false&key=########
Of course, change ######## to your API key (or just remove it altogether).