Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Build Logo using Flickr alphabet pictures in newLISP (See related posts)

// it uses my FLICKR context for newLISP
// demo available at http://terpri.com
(define (alphabet-flickr myletter, alph y myurl)
    (setq alph (xml-digest (FLICKR "flickr.groups.pools.getPhotos" nil
                  (append "group_id=27034531@N00&tags=" myletter))))
    (setq alph (clean nil? (map (lambda(x) (if (= myletter ((x (chop(ref 'title x))) 1)) x)) (\
2 -1 (alph 0 2)))))
    (setq y (first (randomize (sequence 0 (length alph)))))
    (setq y (alph y 1))
    (setq myurl (format "http://static.flickr.com/%s/%s_%s_s.jpg"
                       (lookup 'server y)(lookup 'id y)(lookup 'secret y)))
    (println "<img src=" myurl " border=0>"))

    (if (= page-name "Home")
      (begin
            (println {<div class="flickr_banner">})
            (map (lambda (x) (alphabet-flickr x)) '("T" "E" "R" "P" "R" "I"))
            (println "</div>")))

You need to create an account or log in to post comments to this site.


Click here to browse all 5140 code snippets

Related Posts