cloudTagFlickr
Thanks to Andy Lister for this fanstastic modifiaction to get this working with phpFlickr 2.1.0! CC in effect!
Now at version 1.7! Download the file for details.
I read that “The tag cloud is the mullet of the internet.” Sign me up!
This script pulls your tags from flickr, and arranges them in a number of ways according to the relative counts of the given tags. Update: Now with color!!
If you like the code and use it on site, I’d love to see it and post a link to it from here.
Here’s a simple piece of code that uses the phpFlickr wrapper by Dan Coulter. Get the wrapper here and if you don’t have a flickr api key, get it here.
It produces a string of variable sized tags, scaled with Steingart’s UltraScaleMaxAlGoreRythym, linked to a flickr slide show or just a flickr page with said tags.
Now here’s all you gotta do.
- Download cloudTagFlickr.php
- Open the file in your editor of choice
- Change the values under setup to fit default user name, API key, default max size, and default min size, and whether to use a slideshow or regular show
- If using caching, enter appropriate DB values and enable or disable caching
- Place this file in the same directory your phpFlickr.php file on your web server
- All this does is produce a string of words of different sizes. There’s no right or left alignment, nor any other sytle applied. So when placing it in your code, it should inherit the existing properties, except for font size
- Call the string in a browswer to test it out like so “http://yoursite.com/phpFlickrPath/cloudTagFlickr.php”
If you see a string of your tags listed alphabetically and varied in size, you are in business. To place it in your text just use a php include call.
Modifying the string: you can adjust the min and max font, the sort order, and the username all by applying arugments to the URL.
examples:
- “http://yoursite.com/phpFlickrPath/cloudTagFlickr.php?max=50&min=2″ sets the max font size to 50 and the min font size to 2. Remember that depending on your distribution, the minimum is a bottoming out point, but none of your tags may be so small.
- “http://yoursite.com/phpFlickrPath/cloudTagFlickr.php?name=doofus” applies this script to user name doofus’s tags.
- “http://yoursite.com/phpFlickrPath/cloudTagFlickr.php?sort=random” shuffles the order of the tags in the string. ‘asc’ sorts from lowest to highest popularity, ‘desc’ from highest to lowest.
- “http://yoursite.com/phpFlickrPath/cloudTagFlickr.php?color=greyscale” makes the most popular darkest and it gets lighter from there. ‘hotcold’ goes red to blue. Adding &spread=150 (or anything less than 200) narrows the spectrum produced.
- Mix and match as you like, for example: “http://yoursite.com/phpFlickrPath/cloudTagFlickr.php?sort=asc&max=60&user=nicksthings” would do exactly what you think it should.
New additions! By changing the “mintagcounthreshold” field you can set what the mininum tag count needs to be to display.
By adding a “$tagstoignore[]=’X';” line you can filter out a string that you’d rather not show up, such as “geolat” or “flickrdate” or “zip.” This tool does a sub string match, so if you set “zip” as a tag to ignore, then zip94703 will be filtered, etc.
The default setting is to sort alphabetically with no color gradient and size according to the default values you set below. So you if pass no arguments, this is what you’ll get.
Now, if you want to be really, really lazy, you can just hit my server up for the work IF you add me as a contact on flickr (dansteingart), because I’m a big loser and I smell.