Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit e5f0fadb8ebfcfe830dd0865b06bfdf77463b396 straup committed Apr 19, 2012
Showing with 1,361 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +12 −0 Makefile
  3. +33 −0 README.md
  4. +420 −0 flickr.api.js
  5. +14 −0 flickr.api.min.js
  6. +202 −0 lib/google-compiler/COPYING
  7. +261 −0 lib/google-compiler/README
  8. BIN lib/google-compiler/compiler-20100616.jar
  9. +162 −0 src/flickr.api.js
  10. +256 −0 src/md5.js
@@ -0,0 +1 @@
+*~
@@ -0,0 +1,12 @@
+all: clean js
+
+clean:
+ rm flickr.api.js
+ rm flickr.api.min.js
+
+js:
+ cat src/md5.js > flickr.api.js
+ echo "\n" >> flickr.api.js
+ cat src/flickr.api.js >> flickr.api.js
+
+ java -Xmx64m -jar lib/google-compiler/compiler-20100616.jar --js flickr.api.js > flickr.api.min.js
@@ -0,0 +1,33 @@
+flickrapi-js
+--
+
+A Javascript library for talking to the Flickr API. It is currently incomplete
+and only works for uploading files, and only then does it work in Firefox and
+Opera.
+
+Uploads in Webkit related browsers should be possible but I've not gotten around
+to working out the details yet.
+
+Here's an example of how you might upload the contents of a <canvas> element to
+Flickr:
+
+ var api_key = 'FLICKR_API_KEY';
+ var api_secret = 'FLICKR_API_SECRET';
+ var auth_token = 'FLICKR_AUTH_TOKEN';
+
+ var canvas = document.getElementById("some-canvas-thing");
+
+ var data = canvas.toDataURL();
+ var enc = data.replace("data:image/png;base64,", "");
+ var bytes = base64_decode(enc);
+
+ var fl = flickr.api(api_key, api_secret);
+ fl.upload(bytes, {'auth_token': auth_token});
+
+IMPORTANT: This is still plain old Javascript and if you fill in all those
+FLICKR API key and auth token variables with real data and then put them on the
+public Internet **any one will be able to see them, steal them and start
+uploading stuff to that account**.
+
+This is not a magic pony so be careful how you use it and where.
+
Oops, something went wrong.

0 comments on commit e5f0fad

Please sign in to comment.