this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Tumble buttons now the same

+77
+1
cmd/tumble/main.go
··· 66 66 mux.HandleFunc("/search.cgi", h.Search) 67 67 mux.HandleFunc("/irclink/", h.IRCLinkHandler) // Handles /irclink/?id and posts 68 68 mux.HandleFunc("/ogpreview.cgi", h.OGPreviewHandler) 69 + mux.HandleFunc("/buttons/button.cgi", h.ButtonHandler) 69 70 70 71 // v0 Routes (Aliased) 71 72 mux.HandleFunc("/v0/", h.Index)
+18
internal/handler/handlers.go
··· 274 274 } 275 275 } 276 276 277 + func (h *Handler) ButtonHandler(w http.ResponseWriter, r *http.Request) { 278 + user := r.FormValue("user") 279 + if user == "" { 280 + w.Header().Set("Content-Type", "text/plain") 281 + w.Write([]byte("Oh no! You didn't enter your name!")) 282 + return 283 + } 284 + 285 + data := map[string]string{ 286 + "User": user, 287 + "BaseURL": h.Config.BaseURL, 288 + } 289 + 290 + if err := h.Renderer.Render(w, "tumble_buttons.html", data); err != nil { 291 + log.Printf("Error rendering buttons: %v", err) 292 + } 293 + } 294 + 277 295 func (h *Handler) Search(w http.ResponseWriter, r *http.Request) { 278 296 ctx := r.Context() 279 297 query := r.URL.Query().Get("search")
+58
internal/templates/views/tumble_buttons.html
··· 1 + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 2 + <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 3 + 4 + <head> 5 + <title>tumblefish buttons</title> 6 + <script type="text/javascript"> 7 + var _gaq = _gaq || []; 8 + _gaq.push(['_setAccount', 'UA-24593498-1']); 9 + _gaq.push(['_trackPageview']); 10 + (function() { 11 + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 12 + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 13 + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 14 + })(); 15 + </script> 16 + <link rel="stylesheet" href="http://{{.BaseURL}}/css/screen.css" type="text/css" media="screen" /> 17 + </head> 18 + 19 + <body> 20 + <div id="page"> 21 + <div id="masthead"> 22 + tumblefish. 23 + </div> 24 + 25 + <div id="content"> 26 + <div class="tumble_date"> 27 + <div class="tumble_date_date">!!</div> 28 + <div class="tumble_date_mon">buttons</div> 29 + <div class="tumble_date_day">yay!</div> 30 + </div> 31 + <div class="tumble_item_quote"> 32 + <div class="tumble_item_top"></div> 33 + <span class="tumble_item_quote_quote">So how do I install this crap??</span> 34 + <div class="tumble_item_bottom"></div> 35 + </div> 36 + <div class="tumble_item_ircLink"> 37 + <div class="tumble_item_top"></div> 38 + <span class="tumble_item_ircLink_title"> 39 + Drag this link: <a href="javascript:location.href='http://{{.BaseURL}}/irclink/?user={{.User}}&source=web&url='+encodeURIComponent(location.href)" onclick="window.alert('No clicky! Drag this link to your Bookmarks toolbar or menu, or right-click it and choose Bookmark This Link...');return false;">post to tumblefish!</a> up to your Bookmarks toolbar or menu. 40 + </span> 41 + <div class="tumble_item_bottom"></div> 42 + <div> 43 + <div class="tumble_item_ircLink"> 44 + <div class="tumble_item_top"></div> 45 + <span class="tumble_item_ircLink_title">PS - Unfortunately, tumblebuttons don't work with Microsoft Internet Explorer. MSIE sucks. Stop using it.</span> 46 + <div class="tumble_item_bottom"></div> 47 + </div> 48 + <div> 49 + <div class="tumble_item_ircLink"> 50 + <div class="tumble_item_top"></div> 51 + <span class="tumble_item_ircLink_title">PPS - If your name is Greg Buchanan and you just read the above postscript, you can suck my ass.</span> 52 + <div class="tumble_item_bottom"></div> 53 + 54 + </div> 55 + </div> 56 + </body> 57 + 58 + </html>