webcal:// Format - Export to Google Calendar/iCal - google-calendar-api

I've a home-made php based web calendar which I would like my users to import into Google Calendar, iCal, etc. so they have up-to-date information available on their calendar of choice. I understand providing a webcal link is the way to go but I am not sure how to create it. I've donwloaded an example .ics file but did not have much info..
Where can I find more info on creating a webcal feed? Also, does webcal allow authentication? The feed will most likely be password protected.
Thanks!

A webcal feed use iCalendar format as defined in RFC 5545. It's a rather complex and cumbersome format. You'll find simple examples on wikipedia which may fit your needs. You could also opt to use a library to abstract the format, such as:
http://framework.zend.com/svn/framework/laboratory/Zend_Ical/
http://bennu.sourceforge.net/
http://sourceforge.net/projects/icalcreator/
http://sabre.io/vobject/
From all of these the last one might be your best bet (all others seemed to be dead last time I checked).
As for authentication you may use basic HTTP authentication. Or use a secret token to identify the user (as seen in Google Calendar). Anyway, in both cases you probably should use secure connection (SSL) so data (and passwords) are not sent in clear.
And finally I would recommend the use of webcal:// or webcals:// scheme for ease of use for end-user. But you may face troubles with some clients (eg: Outlook 2007 and forced SSL). I don't have a work-for-all solution yet...
EDIT
I forgot to mention the ICS validator in case you don't use a lib .

Related

Is it possible to write/modify email draft with Qt?

Is it possible to append text to email draft and save it using Qt ? No email sending is involved here, just accessing email draft, modify it and save it.
If so, what libraries/tools are required to do this ?
You didn't specify which email protocol you're interested in, but it doesn't really matter -- Qt has no built-in support for IMAP, MS Exchange, etc.
That said, Qt does include QTcpSocket and QSslSocket. In theory you could implement whichever email protocol(s) you're interested in on top of these TCP socket implementations.
But implementing these protocols is a very significant amount of work and tricky to get right. I can't personally speak to Exchange, but IMAP has several distinct versions and various optional features that some servers support and others don't.
Then there's the issue of the email format itself. As far as I'm aware Qt doesn't include a MIME parser (let me know if I'm wrong about this in the comments.) Parsing MIME is only half the story, because after editing the draft you'll have to create a new MIME document to upload to the server.
After you've figured all of that out you still need to build a user interface that lets you edit the email. Most likely you want to edit HTML-based email, which means you probably want to integrate QtWebEngine and either build your own editor in Javascript or use an existing one.
If I were you I'd recommend using external libraries for whatever email protocol(s) you intend to support as well as dealing with MIME data. Recommending external libraries is off topic for Stack Overflow, but I'm sure you can find one on the web.

How to download article from WSJ with RCurl

I am trying to use RCurl along with XML package to download and mine article from the WSJ (wall street journal). However, whenever i use getURL from RCurl, i do get the version of the article which is available for public viewer.
What i would like to be able to do is to download the full version of the article - as i am paying member. I imagine i have to pass the login credential, when i call the function getURL, however, i am not sure how to do so..
Is this information stored in cookies?
Do i need be "authenticated" - whatever the difference (in purpose maybe) is?
I would appreciate if someone could explain how do website such as WSJ, uses login-info to fetch data, and how can i tweak RCurl in order to take such information into account. A very simple example will go a long way in explaining the different concept of setting cookies (files, jar, ..) etc
Thank you in advance
Typically, authentication information is not stored in cookies. Instead, a "session cookie" is stored on your computer - and refers to authentication stored on the server. See the Session management article on Wikipedia for a bit more information and pointers.
So basically you will need to create a cookie jar file for this site, login with curl (this can be painful, as WSJ doesn't use the standard form-based POST but instead relies on javascript), and then you'll be able to tell curl to re-use the cookie for the following requests on the articles. Read this answer to see how to do it in practice.

iCal - Remote query filter

Maybe dumb question but I'm wondering how iCal clients query a remote calendar.
I've just created a little web service that generates an iCal file. This file is successfully interpreted by Google Calendar and Lightning (new Sunbird). But I'm not filtering on any range of time.
I imagine that Google and Sunbird clients gives parameters to filter on dates at least.
How can I know what are these parameters ? Is it part of the iCal RFC ?
Can someone point me to the good direction ?
When you are just 'subscribing', you're simply downloading the entire file and that's it. No filtering.
However, when you're talking about syncing, the place you need to look at is CalDAV.
https://www.rfc-editor.org/rfc/rfc4791
This is a WebDAV based protocol most major calendar applications use, and does do things like filtering on time ranges and 2-way synchronization.

Is it a good idea to check the HTTP request query string and indicate an error once there's an unexpected parameter?

My ASP.NET application will have to handle HTTP GET requests that will have the following URL format:
http://mySite/getStuff?id="actualIdHere"
currently the requirement is to validate that there're no parameters in the query string except id and indicate an error like "unknown parameter P passed".
Is such requirement a good idea? Will it interfere with some obviously valid cases of using the application I haven't thought of?
It would be better to just validate the presence of id.
Validating unknown parameters doesn't serve much of a purpose, they will just be ignored.
Just edited my answer here:
There are also tracking solutions out there that will add to your query string.
One that comes to mind is web analytics.
If your application is going to be a public web site, you will want to implement some tracking of your traffic (e.g. google analytics).
If you want to implement a marketing campaign to draw traffic to your site, you will likely need to add a few parameters (specific to the tracking system you're using) to your querystring to check the effectiveness of your campaign.
It depends on your target audience.
It is not a good practice for public websites where you are aware of SEO, for example if you implement Google Analytics then a user come to your site from Search Results may have a parameter in URL like googleclid.
However in more protected websites it is fine.
It might affect forward compatiblity. For example, if you have separate client applications/websites that actually call this URLs, and future versions of these clients might provide additional parameters to getStuff (like a sort ordering, backlink, etc), making hard requirements on the parameters might make it harder to roll out new versions smoothly (i.e. cannot roll out new clients until the server is updated).
This in addition to the traffic forwarding parameters public websites might get as additional input, like the other answers mention.

Is JSON still used in applications

I wanted to know if JSON is still used in live applications? I am creating a service and want to understand if I should output data using JSON too?
What is the latest standard now?
JSON is very popular, and there is no sign that this is changing.
I am creating a service and want to understand if I should output data using JSON too?
You really need to ask the potential customers of the service that question. Or at least, give us some hint as to what the service is and what clients are likely to use it.
What is the latest standard now?
There is no official standard for JSON. In theory, JSON is a subset of ECMAScript (aka JavaScript), so the relevant ECMAScript standard would be normative.
In practice, JSON is implemented in many languages independently of ECMAScript. The description on the JSON.org website, and IETF RFC 4627 are probably the most relevant to someone implementing JSON for themselves, but neither of these sources have the authority of a standard. If you want JSON libraries, the JSON.org site is a good place to start looking.
Yes, JSON is still very popular. Even Google web services API gives search output in JSON.
Take a look at this example:
http://zamples.com/JspExplorer/samples/google.jsp
Overwhelmingly yes. For me, JSON is the transport format of choice for AJAX requests and inter-application data sharing. To date, there are 1271 questions about JSON on SO.

Resources