DZone 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

Snippets has posted 5883 posts at DZone. View Full User Profile

Build Logo Using Flickr Alphabet Pictures In NewLISP

  • submit to reddit
        // it uses my FLICKR context for newLISP
// demo available at
(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 ""
                       (lookup 'server y)(lookup 'id y)(lookup 'secret y)))
    (println "<img src=" myurl " border=0>"))

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