Skip to content
Snippets Groups Projects
Commit 67fd6188 authored by Cam Saul's avatar Cam Saul
Browse files

geographical tips dataset

parent 82019fd9
No related branches found
No related tags found
No related merge requests found
......@@ -37,3 +37,144 @@
;; Places, times, and circumstances where Tupac was sighted
(def-database-definition-edn tupac-sightings)
(def-database-definition-edn geographical-tips)
(defn random-venue []
(let [cat-1 (rand-nth ["Paleo" "Free-Range" "Chinese" "Gluten-Free" "Mexican" "Afgan" "American" "BBQ" "Taquería" "Pizza" "Irish" "Low-Carb" "Gormet" "Red White & Blue"
"Japanese" "Korean" "Cage-Free" "GMO-Free" "No-MSG" "Deep-Dish" "Soul Food" "British" "European" "Homestyle" "Old-Fashioned" "Modern"])
cat-2 (rand-nth ["Bakery" "Restaurant" "Café" "Gastro Pub" "Eatery" "Pizzeria" "Taqueria" "Bar & Grill" "Coffee House" "Cupcakes" "Sushi" "Liquor Store"
"Grill" "Diner" "Hotel & Restaurant" "Food Truck" "Pop-Up Food Stand" "Churros" "Ice Cream Truck"])]
{:name (str (rand-nth ["Cam's" "Rasta's" "Joe's" "Kyle's" "Sameer's" "Lucky's" "SF" "Alcatraz" "Oakland" "Mission" "Chinatown" "Pacific Heights" "Nob Hill" "Marina"
"Lower Pac Heights" "Polk St." "Sunset" "Tenderloin" "SoMa" "Market St." "Haight"])
" " cat-1 " " cat-2)
:categories [cat-1 cat-2]
:phone (str "415-" (apply str (repeatedly 3 #(rand-int 10))) "-" (apply str (repeatedly 4 #(rand-int 10))))
:id (str (java.util.UUID/randomUUID))}))
(def venues (repeatedly 100 random-venue))
(defn random-source [venue]
(let [username (rand-nth ["cam_saul" "rasta_toucan" "lucky_pigeon" "sameer" "joe" "bob" "amy" "jane" "jessica" "mandy" "kyle" "tupac" "biggie"])]
((rand-nth [(fn []
{:service "twitter"
:mentions [(str "@" (-> (:name venue)
clojure.string/lower-case
(clojure.string/replace #"\s|-" "_")
(clojure.string/replace #"'" "")))]
:tags (->> (:categories venue)
(interpose " ")
(apply str)
(#(clojure.string/split % #" "))
(map clojure.string/lower-case)
(mapv (partial str "#")))
:username username})
(fn []
{:service "flare"
:username username})
(fn []
{:service "foursquare"
:foursquare-photo-id (str (java.util.UUID/randomUUID))
:mayor username})
(fn []
(let [fb-id (str (java.util.UUID/randomUUID))]
{:service "facebook"
:facebook-photo-id fb-id
:url (str "http://facebook.com/photos/" fb-id)}))
(fn []
{:service "yelp"
:yelp-photo-id (str (java.util.UUID/randomUUID))
:categories (:categories venue)})]))))
(defn random-tip [venue]
(let [adjectives ["great"
"decent"
"acceptable"
"fantastic"
"wonderful"
"amazing"
"delicious"
"atmospheric"
"family-friendly"
"exclusive"
"well-decorated"
"modern"
"classic"
"world-famous"
"popular"
"underappreciated"
"historical"
"swell"
"groovy"
"underground"
"horrible"
"overrated"]]
(str (:name venue)
" is a "
(rand-nth adjectives)
" and "
(rand-nth adjectives)
" "
(if (= (rand-int 1) 0)
"place"
(rand-nth ["local landmark"
"tourist destination"
"hidden gem"
"traditional hippie hangout"
"hipster spot"]))
" to "
(rand-nth ["catch a bite to eat"
"have a after-work cocktail"
"conduct a business meeting"
"pitch an investor"
"have brunch"
"people-watch"
"take visiting friends and relatives"
"meet new friends"
"have a birthday party"
"have breakfast"
"take a date"
"nurse a hangover"
"have a drink"
"drink a craft beer"
"sip a glass of expensive wine"
"sip Champagne"
"watch the Giants game"
"watch the Warriors game"])
" "
(rand-nth ["with friends"
"on a Tuesday afternoon"
"weekend mornings"
"weekday afternoons"
"weekend evenings"
"on Taco Tuesday"
"Friday nights"
"the first Sunday of the month"
"the second Saturday of the month"
"during summer"
"during winter"
"in July"
"in June"
"after baseball games"
"when hungover"
"in the spring"
"in the fall"
"with your pet dog"
"with your pet toucan"
"on Thursdays"
"on Saturday night"
"on public holidays"
])
".")))
(defn random-photo []
(let [url (str "http://cloudfront.net/" (java.util.UUID/randomUUID) "/%s.jpg")
venue (rand-nth venues)]
[(random-tip venue)
{:small (format url "small")
:medium (format url "med")
:large (format url "large")}
(-> venue
(dissoc :cat-1 :cat-2))
(random-source venue)]))
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment