Skip to content

Instantly share code, notes, and snippets.

View ravikiranj's full-sized avatar

Ravikiran Janardhana ravikiranj

View GitHub Profile
@ravikiranj
ravikiranj / index.php
Created March 26, 2011 06:02
HTML for Public Photo Uploader using Flickr
<body>
<div id="doc" class="yui-t7">
<div id="hd" role="banner"><h1>Photo Uploader Using Flickr</h1></div>
<div id="bd" role="main">
<div id="mainbar" class="yui-b">
<?php
if (isset($_POST['name']) && $error==0) {
echo " <h2>Your file has been uploaded to <a href='http://www.flickr.com/photos/61074807@N08/' target='_blank'>rkj_flickr's photo stream</a></h2>";
}else {
@ravikiranj
ravikiranj / index.php
Created March 26, 2011 06:05
PHP Logic for Uploading Photo to Flickr
<?php
//Include phpFlickr
require_once("phpFlickr/phpFlickr.php");
$error=0;
$f = null;
if($_POST){
if(!$_POST['name'] || !$_FILES["file"]["name"]){
$error=1;
@ravikiranj
ravikiranj / getToken.php
Created March 26, 2011 06:07
Default getToken.php file in phpFlickr library
<?php
/* Last updated with phpFlickr 1.4
*
* If you need your app to always login with the same user (to see your private
* photos or photosets, for example), you can use this file to login and get a
* token assigned so that you can hard code the token to be used. To use this
* use the phpFlickr::setToken() function whenever you create an instance of
* the class.
*/
@ravikiranj
ravikiranj / getToken.php
Created March 26, 2011 06:09
Modified version of getToken.php
<?php
/* Last updated with phpFlickr 1.4
*
* If you need your app to always login with the same user (to see your private
* photos or photosets, for example), you can use this file to login and get a
* token assigned so that you can hard code the token to be used. To use this
* use the phpFlickr::setToken() function whenever you create an instance of
* the class.
*/
http://tinyurl.com/create.php?url=yoururl
javascript: url = 'http://tinyurl.com/create.php?url='+encodeURIComponent(location.href); void(window.open(url));
var q = q = document.getSelection();
/* If user has selected nothing on the webpage, show him a prompt box */
if(!q) {
q = prompt('Enter keyword', '');
}
/* If there is a keyword to search for, launch a search query to php.net */
if(q) {
window.open('http://php.net/manual-lookup.php?pattern='+encodeURIComponent(q));
}
javascript:(function(){
/* Your code */
})();
javascript:(function(){var q=document.getSelection();if(!q){q=prompt('Enter%20keyword','');if(q){window.open('http://php.net/manual-lookup.php?pattern='+encodeURIComponent(q));}}})();