Skip to content

Instantly share code, notes, and snippets.

@smtalim
smtalim / weather.go
Created June 1, 2014 06:39
weather.go
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"sync"
The MIT License (MIT)
Copyright (c) [2014] [Satish Talim]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

An Internal Project: redditnews

baby-gopher

These projects specifications were given to a "Baby Gopher".

"I am keen to be abreast with what's happening in the Golang world. To that end, we will write a command-line program (redditnews.go) that fetches and displays the latest headlines from the golang page on Reddit.

The program will:

// redditnews package implements a basic client for the Reddit API.
package redditnews
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
package redditnews
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
)
@smtalim
smtalim / redditmail.go
Last active August 29, 2015 14:01
redditmail.go
package main
import (
"github.com/SatishTalim/redditnews"
"log"
"net/smtp"
)
func main() {
to := "satish@joshsoftware.com"
@smtalim
smtalim / reddit.go
Created May 19, 2014 02:45
reddit.go command-line client
package main
import (
"fmt"
"github.com/SatishTalim/redditnews"
"log"
)
func main() {
items, err := redditnews.Get("golang")
@smtalim
smtalim / redditnews4.go
Last active August 29, 2015 14:01
Fourth Iteration
package redditnews
import (
"encoding/json"
"errors"
"fmt"
"net/http"
)
type Item struct {
@smtalim
smtalim / redditnews3.go
Last active August 29, 2015 14:01
Third Iteration
package main
import (
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
)
@smtalim
smtalim / redditnews2.go
Last active August 29, 2015 14:01
Second Iteration
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
)
type Item struct {