MINI Cooper MINI Cooper specs
MINI Cooper MINI Cooper Forums MINI Cooper Pictures
Mark Forums Read MINI Cooper radio MINI Cooper latest news
 
Welcome to North American Motoring, the North American MINI Community of owners and enthusiasts!

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and photo galleries. By joining our free community you will have access to post topics, communicate privately with other MINI enthusiasts (PM), respond to polls, upload your own photo gallery and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact our support team.


Go Back   North American Motoring > MINIs in General > MINI Camera and Video
Not a member? Register now!

Welcome to North American Motoring !
Welcome to North American Motoring,

You are currently viewing our forum as a guest, which gives you limited access to view most discussions and access our other features. By joining our community, at no cost, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is free, fast and simple, so please join our community today!


» Main Menu
Upgrade Garage


» Latest Main Topics
MINIUSA letter regarding...
Show me your WHEELS!
Riss Racing R56 MINI Exhaust!...
could BMW decide to kill off...
Clutch not covered under...
How do i tell when coilovers...
Looking for pics of modded...
Seat recline not working
How do I detach the rear view...
Anybody else in Week 19...
Advertisement

Vendor

 Aftermarket vendors


Reply
 
Thread Tools Display Modes
  #1  
Old 01-10-2006, 03:55 PM
snid snid is offline
6th Gear
iTrader: 0% (0)
 
Join Date: Jul 2002
Location: Burlington, VT
Posts: 2,023
Gallery
flickrSig

I'm writing up a little doo-dad that will let you put thumbnails of images stored in flickr in you sig here on NAM.

First off, if all you want to do is put a specific picture's thumbnail in your sig, that's easy... find the image in flickr, click on the "All Sizes" button on the images page, click on the "thumbnail" link, grab the URL from where it says "1. Grab the photo's URL:", and put it inside an [img] tag, so it looks like this:

[img]http://static.flickr.com/5/9845471_703350e9e7_t.jpg[/img]

That will put a specific image's thumbnail in your signature (or in a post, for that matter). Great.

But, what if you want your signature to always contain your most recent upload to flickr? Here's what you can do:

[img]http://joshwardell.com/snid/flickrSig.php5?u=username&n=number[/img]
where username is you flickr username, and number is how far back in your photostream to go - 0 is the most recent photo, 1 is the photo before that, etc - I think you can only go back to photo 9... trying 10 breaks things.

So, as an example, [img]http://joshwardell.com/snid/flickrSig.php5?u=snid&n=0[/img] would load my most recent flickr upload's thumbnail. Like this:

Doing a sig like this:
[img]http://joshwardell.com/snid/flickrSig.php5?u=snid&n=0[/img] [img]http://joshwardell.com/snid/flickrSig.php5?u=snid&n=1[/img] [img]http://joshwardell.com/snid/flickrSig.php5?u=snid&n=2[/img] [img]http://joshwardell.com/snid/flickrSig.php5?u=snid&n=3[/img] [img]http://joshwardell.com/snid/flickrSig.php5?u=snid&n=4[/img]

will display my five most recent uploads:


No we're getting somewhere... Josh said "how about a random photo?" Alright, use "r" for the number, and you'll get a random photo. Like this: [img]http://joshwardell.com/snid/flickrSig.php5?u=snid&n=r[/img]

Like this:


Unfortunately, if you try to put a bunch of random photos together, they all wind up being the same. Like this:

There might be a way to fix that, but it doesn't work right now.

Since Juan created the northamericanminiacs group in flickr, I decided it would only make sense to work with groups instead of users if you wanted to. So, you can make URLs like this:
[img]http://joshwardell.com/snid/flickrSig.php5?g=groupname&n=number[/img]

Notice the use of g instead pf u. For example, this will grab the most recent upload to the "northamericanminiacs" group:
[img]http://joshwardell.com/snid/flickrSig.php5?g=northamericanminiacs&n=0[/img]

Like this:


Or, a random picture from the group:
[img]http://joshwardell.com/snid/flickrSig.php5?g=northamericanminiacs&n=r[/img]

Like this:


but there's still the same problem with trying to get more than one different random picture at a time.

I'll probably add some more goodies in the future, like stuff to let you make the pictures be links to the picture in flickr.

The biggest problem with using this stuff as a signature here on NAM is that signatures are capped at 300 characters, and URLs are kinda long.
__________________
Team Justacooper
98 hp at the wheels!
Reply With Quote
  #2  
Old 01-10-2006, 05:35 PM
blalor blalor is offline
6th Gear
iTrader: 0% (0)
 
Join Date: Jan 2005
Location: Nashua, NH
Posts: 1,214
Gallery
Nice work, guys! Couple of comments. Trying to retrieve multiple random images probably won't work until you add a parameter to the URL. I'm thinking that the browser just uses the first image returned every time it sees that URL. The browser (or at least smart ones) doesn't make 1,000 requests to nam.com every time MINIClo posts with 1,000 smilies, right? ;-)

2nd, you *could* use something like tinyurl.com to "compress" the URLs, thus getting around the 300 character space cap.

It's a shame I won't be able to see the fruits of your labors; I've got signatures turned off. :-)
Reply With Quote
  #3  
Old 01-10-2006, 06:26 PM
snid snid is offline
6th Gear
iTrader: 0% (0)
 
Join Date: Jul 2002
Location: Burlington, VT
Posts: 2,023
Gallery
Yup, that's the trick to different random photos - the URLs have to be different. Stick something like &1 on the end of the URL, but with a different number to make the URLs different, and you get different images. Like so:

[img]http://joshwardell.com/snid/flickrSig.php5?u=snid&n=r&1[/img]
[img]http://joshwardell.com/snid/flickrSig.php5?u=snid&n=r&2[/img]
[img]http://joshwardell.com/snid/flickrSig.php5?u=snid&n=r&3[/img]






I think I'll make it a little easier to understand, though, and do something like n=r1, n=r2,etc... but not tonight.
__________________
Team Justacooper
98 hp at the wheels!
Reply With Quote
  #4  
Old 01-10-2006, 06:41 PM
blalor blalor is offline
6th Gear
iTrader: 0% (0)
 
Join Date: Jan 2005
Location: Nashua, NH
Posts: 1,214
Gallery
Would you mind making your source available? I've got a couple of things I wouldn't mind trying, just for the heck of it....
Reply With Quote
  #5  
Old 01-10-2006, 06:51 PM
snid snid is offline
6th Gear
iTrader: 0% (0)
 
Join Date: Jul 2002
Location: Burlington, VT
Posts: 2,023
Gallery
Quote:
Originally Posted by blalor
Would you mind making your source available? I've got a couple of things I wouldn't mind trying, just for the heck of it....
There's no reason for the average Joe to read / understand this post.

No problem. All the hard work was done by someone else, anyway.

The flickr specific stuff is from this php library: http://www.drewish.com/projects/phlickr/

Here's the code I wrote (as it stands right now). My flickr API key and secret number have been removed from the code, just becuase:

#!/usr/local/php5/bin/php -q
<?php
require_once 'Phlickr/Api.php';
require_once 'Phlickr/User.php';
define('FLICKR_API_KEY', 'my key - get your own');
define('FLICKR_API_SECRET', 'my secret');
$api = new Phlickr_Api(FLICKR_API_KEY, FLICKR_API_SECRET);
$username=$_GET["u"];
$groupname=$_GET["g"];
$photoNum=$_GET["n"];
if(!empty($groupname)){
$group = Phlickr_Group::findByUrl($api, "http://flickr.com/groups/".$groupname."/");
$photolist = $group->getPhotoList();
}
if(!empty($username)){
$user = Phlickr_User::findByUsername($api, $username);
$photolist = $user->getPhotoList();
}
if($photoNum=="r"){
$url=$photolist->getRandomPhoto()->buildImgUrl(Phlickr_Photo::SIZE_100PX);
}
else{
$photos = $photolist->getPhotos();
$url=$photos[$photoNum]->buildImgUrl(Phlickr_Photo::SIZE_100PX);
}
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header('location:'.$url);
?>


This is my first ever php script, and I would still say that I know nothing about PHP.
__________________
Team Justacooper
98 hp at the wheels!
Reply With Quote
  #6  
Old 01-10-2006, 08:39 PM
blalor blalor is offline
6th Gear
iTrader: 0% (0)
 
Join Date: Jan 2005
Location: Nashua, NH
Posts: 1,214
Gallery
What I was thinking is that, although it's cool to have the pictures there, they're awful small, and you've got no way to get to the image's page on Flickr. Wrapping them in a \[url\] block would be the way to go, in my opinion. It'd be tricky to do that, however, given the limitations of this (stupid) bulletin board software. Yes, I really do loathe vBulletin... :-)

One idea (persistence mechanism warning!) might be to keep track of the referrer (and possibly also use a cookie) so that you could do something like this:
Quote:

[url=http://example.com/flickrSigLink?n=r&u=blalor&ind=0][img]http://example.com/flickrSigImg?n=r&u=blalor&ind=0[/img][/url]
[url=http://example.com/flickrSigLink?n=r&u=blalor&ind=1][img]http://example.com/flickrSigImg?n=r&u=blalor&ind=1[/img][/url]
...
ad infinitum
Er, or something like that. Bedtime, now.
Reply With Quote
  #7  
Old 01-10-2006, 10:11 PM
blacknblue's Avatar
blacknblue blacknblue is offline
Photographer / Beer Dude
iTrader: 0% (0)
 
Join Date: Jul 2003
Location: SoCal (562)
Posts: 2,294
Gallery
I don't know a thing about what you guys are discussing here but I can see the passion, and that's good.


As for me, I'm happy to have helped generate at least some interest in all this.
__________________
My: My Flickr | My Twitter | My iPhone Photography
Reply With Quote
  #8  
Old 01-11-2006, 06:43 AM
adame adame is offline
Coordinator :: MINIsota Motoring Society (MMS)
iTrader: 0% (0)
 
Join Date: Dec 2002
Location: MPLS. MN
Posts: 867
Gallery
Wonderful job so far you guys! Thanks for the insight on this stuff.
__________________
Follow our adoption process
2002 BRG/w MC. Sport package/sunroof. Yakima roof rack in the summer, Blizzaks in the winter. Motoring since July 2002 we've seen 120 temps, -20 temps, 5 accidents and 122,296+ miles.
Flickr|MINI|Cats|BCR|MMC#3
Reply With Quote
  #9  
Old 01-11-2006, 06:37 AM
Minsian's Avatar
Minsian Minsian is offline
2nd Gear
iTrader: 0% (0)
 
Join Date: Dec 2005
Location: Wilmington, DE
Posts: 102
Gallery
Awesome! I'm doing this right now! Thanks for putting work into this and thank you to jwardell for hosting the code...

man...ask and ye shall receive on NAM!
Reply With Quote
  #10  
Old 01-11-2006, 07:40 AM
AndyWSea's Avatar
AndyWSea AndyWSea is offline
5th Gear
iTrader: 0% (0)
 
Join Date: Nov 2005
Location: Seattle, WA
Posts: 651
Gallery
This is awesome! Great job!
Reply With Quote
  #11  
Old 01-11-2006, 07:43 AM
The Short Bus's Avatar
The Short Bus The Short Bus is offline
6th Gear
iTrader: 0% (0)
 
Join Date: May 2005
Location: Richmond, VA
Posts: 4,053
Gallery
thanks for the help
__________________

After 3 long years, I'm back in a MINI! This time, an S!
Reply With Quote
  #12  
Old 01-13-2006, 10:54 AM
jwardell jwardell is offline
6th Gear
iTrader: 0% (0)
 
Join Date: May 2004
Location: Newton, MA
Posts: 1,390
Gallery
Awesome job jason--I didn't realize you kept on working on it after you got it working.

Now for a request Add Set capability. So you can make a specific set of photos that you want to display in your signature. That's exactly what I do for the top of my MINI page.
Reply With Quote
  #13  
Old 01-13-2006, 11:24 AM
blacknblue's Avatar
blacknblue blacknblue is offline
Photographer / Beer Dude
iTrader: 0% (0)
 
Join Date: Jul 2003
Location: SoCal (562)
Posts: 2,294
Gallery
Quote:
Originally Posted by jwardell
That's exactly what I do for the top of my MINI page.
Hey, that's cool Josh! And all this time I thought it was one of those Flickr Badges.
__________________
My: My Flickr | My Twitter | My iPhone Photography
Reply With Quote
  #14  
Old 01-13-2006, 11:28 AM
jwardell jwardell is offline
6th Gear
iTrader: 0% (0)
 
Join Date: May 2004
Location: Newton, MA
Posts: 1,390
Gallery
It is a flickr badge. It gets the images out of a flickr set.
Reply With Quote
  #15  
Old 01-13-2006, 10:57 AM
jwardell jwardell is offline
6th Gear
iTrader: 0% (0)
 
Join Date: May 2004
Location: Newton, MA
Posts: 1,390
Gallery
I just checked bandwidth. No major change. There is a detectable jump in requests. Nothing major.
Code:
Total HTTP FTP/SFTP Mail Date Megabytes Requests Megabytes Requests Megabytes Requests Megabytes Quantity 2006-01-12 18.93 1,897 18.925 1,897 0.000 0 0.000 0 2006-01-11 85.78 2,269 85.782 2,269 0.000 0 0.000 0 2006-01-10 209.15 2,477 163.980 2,475 45.166 2 0.000 0 2006-01-09 215.02 1,547 214.874 1,520 0.144 27 0.000 0 2006-01-08 46.31 823 46.306 823 0.000 0 0.000 0 2006-01-07 109.64 790 109.639 790 0.000 0 0.000 0 2006-01-06 111.75 1,323 111.747 1,323 0.000 0 0.000 0 2006-01-05 106.93 1,637 106.930 1,637 0.000 0 0.000 0 2006-01-04 10.07 1,516 10.075 1,516 0.000 0 0.000 0 2006-01-03 17.44 1,302 17.443 1,302 0.000 0 0.000 0 2006-01-02 40.40 1,540 40.402 1,540 0.000 0 0.000 0 2006-01-01 62.07 717 62.067 717 0.000 0 0.000 0
edit: hmm. nam must ignore the code tag. Pretend those columns line up.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


MINI CooperMINI Cooper PrivacyMINI Cooper Terms of UseMINI Cooper Guidelines MINI Cooper Advertising The North American MINI Cooper Community
  MINI Cooper news, forums, FAQs, and reviews for enthusiasts and owners of the North American MINI Cooper
All times are GMT -7. The time now is 06:55 PM.
 Copyright © 2002-2008 North American Motoring. All Rights Reserved.     Powered by vBulletin and vBulletin Plugins by Drive Thru Online, Inc.

Search Engine Friendly URLs by vBSEO 3.2.0