Link to add to Google calendar - google-calendar-api

I am unclear about the exact format to have a link on a website that will add a single event to a users Google calendar. I see that eventbrite has done it here but I would love some clear specs or links in the right direction
http://www.eventbrite.com/event/1289487893
http://screencast.com/t/6vvh1khS

Here's an example link you can use to see the format:
https://www.google.com/calendar/render?action=TEMPLATE&text=Your+Event+Name&dates=20140127T224000Z/20140320T221500Z&details=For+details,+link+here:+http://www.example.com&location=Waldorf+Astoria,+301+Park+Ave+,+New+York,+NY+10022&sf=true&output=xml
Note the key query parameters:
text
dates
details
location
Here's another example (taken from http://wordpress.org/support/topic/direct-link-to-add-specific-google-calendar-event):
<a href="http://www.google.com/calendar/render?
action=TEMPLATE
&text=[event-title]
&dates=[start-custom format='Ymd\\THi00\\Z']/[end-custom format='Ymd\\THi00\\Z']
&details=[description]
&location=[location]
&trp=false
&sprop=
&sprop=name:"
target="_blank" rel="nofollow">Add to my calendar</a>
Here's a form which will help you construct such a link if you want (mentioned in earlier answers):
https://support.google.com/calendar/answer/3033039
Edit: This link no longer gives you a form you can use

There is a comprehensive doc for google calendar and other calendar services: https://github.com/InteractionDesignFoundation/add-event-to-calendar-docs/blob/master/services/google.md
An example of working link: https://calendar.google.com/calendar/render?action=TEMPLATE&text=Bithday&dates=20201231T193000Z/20201231T223000Z&details=With%20clowns%20and%20stuff&location=North%20Pole

I've also been successful with this URL structure:
Base URL:
https://calendar.google.com/calendar/r/eventedit?
And let's say this is my event details:
Title: Event Title
Description: Example of some description. See more at https://stackoverflow.com/questions/10488831/link-to-add-to-google-calendar
Location: 123 Some Place
Date: February 22, 2020
Start Time: 10:00am
End Time: 11:30am
Timezone: America/New York (GMT -5)
I'd convert my details into these parameters (URL encoded):
text=Event%20Title
details=Example%20of%20some%20description.%20See%20more%20at%20https%3A%2F%2Fstackoverflow.com%2Fquestions%2F10488831%2Flink-to-add-to-google-calendar
location=123%20Some%20Place%2C%20City
dates=20200222T100000/20200222T113000
ctz=America%2FNew_York
Example link:
https://calendar.google.com/calendar/r/eventedit?text=Event%20Title&details=Example%20of%20some%20description.%20See%20more%20at%20https%3A%2F%2Fstackoverflow.com%2Fquestions%2F10488831%2Flink-to-add-to-google-calendar&location=123%20Some%20Place%2C%20City&dates=20200222T100000/20200222T113000&ctz=America%2FNew_York
Please note that since I've specified a timezone with the "ctz" parameter, I used the local times for the start and end dates. Alternatively, you can use UTC dates and exclude the timezone parameter, like this:
dates=20200222T150000Z/20200222T163000Z
Example link:
https://calendar.google.com/calendar/r/eventedit?text=Event%20Title&details=Example%20of%20some%20description.%20See%20more%20at%20https%3A%2F%2Fstackoverflow.com%2Fquestions%2F10488831%2Flink-to-add-to-google-calendar&location=123%20Some%20Place%2C%20City&dates=20200222T150000Z/20200222T163000Z

For the next person Googling this topic, I've written a small NPM package to make it simple to generate Google Calendar URLs. It includes TypeScript type definitions, for those who need that. Hope it helps!
https://www.npmjs.com/package/google-calendar-url

Or use this link. It would generate the link from the input fields

Related

How to specify timezones for World Clock in Bosun?

How should I specify timezones for Word Clock in Bosun config?
I think there was some parameter for that but I can't find reference in docs for that.
The configuration parameter for the worldclock links is timeAndDate. Note this ONLY controls the links generated when displaying datetimes and doesn't control Bosun's timezone, which is hardcoded to UTC.
In the code:
TimeAndDate []int // timeanddate.com cities list
So our config file looks like:
timeAndDate = 202,75,179,136
Which adds Portland, Denver, New York, and London to the datetime links generated in alerts:
See http://www.timeanddate.com/worldclock/converter-about.html for how to get a list of Cities, and then you will find the p_=### codes in the URL that you can add to your Bosun config.
I've created an issue in the github issue tracker to get this fixed.

On Phabricator get the comment from a feed story

I'm using Phabricator's feed.http-hooks feature to post messages in a dev chat room whenever relevant events happen in the news feed. This works great for showing that "Alice created diff D12345" or "Bob updated diff D54321."
When someone comments on a diff, I want to extract the comment text from the story. Whenever there's a comment, Phabricator sends HTTP POSTs to my feed.http-hooks server containing parameters like the following:
storyID=42
storyType=PhabricatorApplicationTransactionFeedStory
storyData[objectPHID]=PHID-DREV-blahblah1
storyData[transactionPHIDs][0]=PHID-DREV-blahblah2
storyAuthorPHID=PHID-USER-blahblah3
storyText=tom added a comment to D12345: Some random diff.
epoch=1412243745
My question is, how can I get the actual text of the comment? I've tried using Conduit's phid.query method to look up some of these PHIDs, but that hasn't gotten me anywhere. I know this is possible because the comment shows up in the actual "Recent Activity" feed on the Phabricator site. Halp.

How to get time remaining in Groupon Html?

I cannot get time remaining from groupon HTML. I did find a method before by hitting the link and it returned in JSON format, but that link no longer works.
So is there any way to get the time remaining from the deals? Only for goods, getaways, and all deals.I can get from the now deals(that is just text) unlike others which is a countdown counter.
To be on same page lets start with this link:
http://www.groupon.com/deals/3rd-coast-cruising-1?c=all&p=23
And before I used to hit:
http://www.groupon.com/deals/3rd-coast-cruising-1/deal_status.json
And got information including the remaining time, but it's not doing so any longer.
It's still there, in the form of a timestamp. Using the source of the first link:
<li class='groupon_countdown' data-deadline='1337576399' ...
And in the second link:
"deadline":"1337576399"
I don't know what language you're using, but with python you can convert this to a readable format like this:
>>>import time
>>>time.asctime(time.localtime(1337576399))
'Mon May 21 06:59:59 2012'
Which corresponds with now + the time left on their timer, in my timezone anyway.

I want to port my delicious bookmarks to my website

I started building a app that will automatically download my delicious bookmarks, and save to a database, so they I can view them on my own website in my favoured format.
I am forced to use oAuth, as I have a yahoo id to login to delicious. The problem is I am stuck at the point where oAuth requires a user to manually go and authenticate.
Is there a code/ guidelines available anywhere I can follow? All I want is a way to automatically save my bookmarks to my database.
Any help is appreciated. I can work on java, .net and php. Thanks.
Delicious Provides an API for this already:
https://api.del.icio.us/v1/posts/all?
Returns all posts. Please use sparingly. Call the update function to see if you need to fetch this at all.
Arguments
&tag={TAG}
(optional) Filter by this tag.
&start={#}
(optional) Start returning posts this many results into the set.
&results={#}
(optional) Return this many results.
&fromdt={CCYY-MM-DDThh:mm:ssZ}
(optional) Filter for posts on this date or later
&todt={CCYY-MM-DDThh:mm:ssZ}
(optional) Filter for posts on this date or earlier
&meta=yes
(optional) Include change detection signatures on each item in a 'meta' attribute. Clients wishing to maintain a synchronized local store of bookmarks should retain the value of this attribute - its value will change when any significant field of the bookmark changes.
Example
$ curl https://user:passwd#api.del.icio.us/v1/posts/all
<posts tag="" user="user">
<post href="http://www.weather.com/" description="weather.com"
hash="6cfedbe75f413c56b6ce79e6fa102aba" tag="weather reference"
time="2005-11-29T20:30:47Z" />
...
<post href="http://www.nytimes.com/"
description="The New York Times - Breaking News, World News & Multimedia"
extended="requires login" hash="ca1e6357399774951eed4628d69eb84b"
tag="news media" time="2005-11-29T20:30:05Z" />
</posts>
There are also public and private RSS feeds for bookmarks, so if you can read and parse XML you don't necessarily need to use the API.
Note however that if you registered with Delicious after December, and therefore use your Yahoo account, the above will not work and you'll need to use OAuth.
There are a number of full examples on the Delicious support site, see for example: http://support.delicious.com/forum/comments.php?DiscussionID=3698

How to modify page URL in Google Analytics

How can you modify the URL for the current page that gets passed to Google Analytics?
(I need to strip the extensions from certain pages because for different cases a page can be requested with or without it and GA sees this as two different pages.)
For example, if the page URL is http://mysite/cake/ilikecake.html, how can I pass to google analytics http://mysite/cake/ilikecake instead?
I can strip the extension fine, I just can't figure out how to pass the URL I want to Google Analytics. I've tried this, but the stats in the Google Analytics console don't show any page views:
pageTracker._trackPageview('cake/ilikecake');
Thanks,
Mike
You could edit the GA profile and add custom filters ...
Create a 'Search and Replace' custom filter, setting the filter field to 'Request URI' and using something like:
Search String: (.*ilikecake\.)html$
Replace String: $1
(was \1)
Two possibilities come to mind:
it can take a while, up to about 24 hours, for visits to be reflected in the Analytics statistics. How long ago did you make your change?
try beginning the pathname with a "/", so
pageTracker._trackPageview('/cake/ilikecake');
and then wait a bit, as per the first item.
Usually you have the ga script code at the end of your file, while special _trackPageviews() calls are often used somewhere else.
Have you made sure you have your call to pageTracker._trackPageview() after you have defined the pagetracker?
Like this:
var pageTracker = _gat._getTracker("UA-XXXXXXX-X");
pageTracker._trackPageview();
otherwise you just get a JavaScript error I suppose.

Resources