may I know how do you find out when a particular URL was shortened using Bitly?
Just add "+" to the end of the URL in your browser
The info endpoint for the API includes that information as ...data.info[0].created_at.
Related
I am faced with a LinkedIn sharing issue.
This issue probably reproducible from March 1st 2019.
I share some url e.g. https://www.linkedin.com/sharing/share-offsite/?url=SHARE_URL#HASH
Worked before: link in post(href) - SHARE_URL#HASH
Works now: link in post(href) - value of og:url meta tag from SHARE_URL#HASH page
So we lose request parameters in SHARE_URL and #HASH
How we can pass link for LinkedIn post into request?
You need to do URL-encoding with parameters you are feeding to another URL. So, this is what you should want...
https://www.linkedin.com/sharing/share-offsite/?url=SHARE_URL%23HASH
Remember, URL's use things like ? and # to indicate a special argument occurring after this character. So, for instance, example.com/share.php?title=thisistitleright?&..., how would the browser know that the first ? indicates the GET param and the second ? is a part of the title argument? Easy: URL encoding.
In case you want to know more: Official LinkedIn Share Documentation
I am trying to output the content of a Google Analytics segment using a script called Oochart.
To do this I need the segment ID, how do I find this?
There's no simple way. You either have to try to read it from the URL when you apply the segment, or select the segment in the query explorer (http://ga-dev-tools.appspot.com/explorer/) which will then show the segment ID.
While the best answer is the one from LCarey (to use the Query Explorer: http://ga-dev-tools.appspot.com/explorer/) I found that the answer from Pavel needs update if you want to go that way instead, as the URL structure has changed.
Consider the following URL:
https://analytics.google.com/analytics/web/#report/defaultid/a23080303w45291587p45450834/%3F_.useg%3DuserfSRDEURzSXe_Kspo6mxgXw/
You're looking for the string "_.useg%3Duser", after which the segment ID (fSRDEURzSXe_Kspo6mxgXw) follows. To use this in API I would use gaid::fSRDEURzSXe_Kspo6mxgXw.
The advanced segment feed provides a listing of all the default and user-created advanced segments. You can retrieve the ID of all the segments here in this standalone Explorer. (under the Try it! headline):
https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/segments/list#try-it
You'll need to authenticate the requests using OAuth 2.0.
As LCarey briefly mentioned, you can read it from URL. I will clarify that by example.
Apply the segment and see the URL.
Example:
https://www.google.com/analytics/web/#report/visitors-overview/a27824002w53282758p54121492/%3F_.advseg%3Duser1417962107/
You are looking for advseg parameter. In this case the segment ID is user1417962107. Characters %3D mean encoded equal sign "=".
In API you would use segment=gaid::user1417962107
I am using the Google QR-Code API to create a QR-Code that includes a URL. This is the URL I am using:
https://chart.googleapis.com/chart?chs=500x500&cht=qr&chl=http://www.test.de/Web/Portale/Form.aspx?PortalId=1&FormName=DetailsForm1&EstateId=14490
What I want in the QR-Code is:
http://www.test.de/Web/Portale/Form.aspx?PortalId=1&FormName=DetailsForm1&EstateId=14490
What I get is:
http://www.test.de/Web/Portale/Form.aspx?PortalId=1
So its cutting at the "&". Any ideas how to solve that?
Thanks :-)
You have to escape for your URL part before parsing into chl parameter.
A simple way would be replacing & with %26 for your url portion.
Try this instead: https://chart.googleapis.com/chart?chs=500x500&cht=qr&chl=http://www.test.de/Web/Portale/Form.aspx%3FPortalId=1%26FormName=DetailsForm1%26EstateId=14490
You need to URL encode the value of the chl parameter. Otherwise the & in that embedded URL will be interpretted as a delimiter for the parameters in the querystring of the outer googleapis.com URL.
If you are using Javascript you can use encodeURIComponent('http://www.test.de/Web/Portale/Form.aspx?PortalId=1&FormName=DetailsForm1&EstateId=14490') to do the encoding.
Solved this, the solution was to use the following code:
Server.UrlEncode(string url)
Now it works perfectly :).
Thanks, encoding was what made it click for me :).
Would any body know if it is possible to search calendar events with a url string?
For example with gMail you could use:
https://mail.google.com/mail/?shva=1#search/Search+Term
to search for the words 'search' and 'term'
Any help or advice greatly appreciated.
Cheers
Noel
This is how you can search Google Calendar using a query parameter in the url:
https://www.google.com/calendar/render?q=TERM
where TERM is the string you're searching for.
So, you can search using a GET request.
Using Chrome's dev tools, it appears as though Google Calendar searches are performed using a POST request, so you won't be able to pass search terms into urls to fetch a response (which would be a GET request).
Update: Looks like a GET request will still return results, but the response is some form of JSON.
Here is the url (I x'd out my specific info), looks like its not meant for what you want to use it for:
https://www.google.com/calendar/search?ctz=America/New_York&hl=en&as_tp=basic&as_myuids=xxx&as_otheruids=xxx&as_q=kai%20mallea&as_cal=xxx;xxx&secid=xxx
A generalization of the current answer is:
https://calendar.google.com/calendar/b/0/render?q=TERM
where 0 is the index of the desired Google account (if you have multiple accounts).
For example:
http://stackoverflow.com/questions/698627/ms-access-properties
The number is part of the URL but is an argument to the web app as opposed to other options like:
http://www.google.com/firefox?client=firefox-a&rls=org.mozilla:en-US:official
where all the args come after the '?'. I have used the second form before and I'm only trying to learn about the first form.
I'm sure I can find what else I need once I known what that's called so I can Google it.
URL Rewriting, generally.
Edit: Here is a good introduction to URL Rewriting.
Variables passed in the form of a URL are called the Query String. In a url like:
http://examples.com?a=b&c=d&e=f
The query string is ?a=b&c=d&e=f
In the Stackoverflow example, it uses URL Rewriting, specifically with MVC Routing to make 'pretty URLs'. There are other ways to do it in other languages. Some make use of Apache's mod_rewrite (example) while others parse the requested URI. In PHP a url like
http://example.com/index.php/test/path/info
can be parsed by reading $_SERVER['PATH_INFO'] which is /text/path/info.
Generally, they are using URL Rewriting to simulate the query string however. In the Stackoverflow example:
http://stackoverflow.com/questions/698711/what-is-the-name-for-that-thing-that-lets-part-of-the-url-be-an-argument
The important parts are the questions/698711. You can change the title of the question with impunity but the other two parts you cannot.
It's usually called the 'path info'.
That's just URL mapping. It lets you use pretty URLs instead of a large query string.
I believe the StackOverflow URL works that way because it is using MVC whereas your bottom example is using standard requests.
It is indeed done by URL rewriting.
Usually, web application frameworks do this automatically if you install it correctly on your server.
Check out CakePHP as an example.
It's called a URL parameter and uses the HTTP GET method. As others mentioned, it can be rewritten using URL rewriting so that the URL is easier to read and use. Some search keywords: "SEF URLs", "Apache Rewrite", "pretty URLs".