Skip to content

Instantly share code, notes, and snippets.

Paul Kinlan PaulKinlan

Block or report user

Report or block PaulKinlan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:2853874
window.addEventListener("load", function() {
if(window.intent && window.intent.action === "http://webintents.org/save") {
var data = window.intent.data;
if(data instanceof Blob) {
// do something with the blob.
}
else {
// do something with the object.
View gist:2853817
var i = new Intent({
"action": "http://webintents.org/save",
"type": "image/*",
"data": blob
})
var onsuccess = function(data) {
var img1 = document.getElementById("img1");
img1.src = URL.createObjectURL(data);
};
View edit-intent-tag.html
<intent
action="http://webintents.org/edit"
type="image/*"
href="edit.html"
/>
View subscribe.html
<!doctype html>
<html>
<head>
<intent action="http://webintents.org/subscribe" type="application/atom+xml" />
<script src="http://webintents.org/webintents.min.js"></script>
</head>
<body>
<button id="go">Go</button>
</body>
@PaulKinlan
PaulKinlan / gist:1222849
Created Sep 16, 2011 — forked from ianb/gist:1222633
Web Intent use case brainstorm
View gist:1222849

Use Cases

Screen scrape microdata:

  • grab an ical event (send)
  • grab an hcard
  • atom feed
  • make note of an hreview (actually I can't think of what you'd do with an hreview)
  • ? generic grabbing, or we specifically figure out support for particular kinds of data (i.e., microformats.org specs)
View dataUriForStylesheet.js
var toDataURI = function(datatype, data) {
return "data:" + datatype +";base64," + window.btoa(data);
};
var renderStyleSheet = function() {
var link = document.createElement("link");
link.rel = "stylesheet";
link.href = toDataUri("text/css", "body { background-color: red;}" );
document.head.appendChild(link);
};
You can’t perform that action at this time.