Skip to content

Instantly share code, notes, and snippets.

@wwwjfy
Created February 24, 2014 15:55
Show Gist options
  • Save wwwjfy/9190981 to your computer and use it in GitHub Desktop.
Save wwwjfy/9190981 to your computer and use it in GitHub Desktop.
cron script to get daily deal of Kindle Store in Amazon China
package main
import (
"fmt"
"log"
"os"
"github.com/PuerkitoBio/goquery"
)
func main() {
url := "http://www.amazon.cn/gp/feature.html?ie=UTF8&docId=126758"
resp, err := goquery.NewDocument(url)
if err != nil {
log.Fatal(err)
os.Exit(1)
}
fmt.Printf("Kindle Special:")
resp.Find("td.amabot_center div:nth-child(3) table tbody tr td div table tbody tr:nth-child(2) td:nth-child(odd)").Each(func(i int, s *goquery.Selection) {
fmt.Printf("%s ", s.Text())
})
}
@tu1988
Copy link

tu1988 commented Oct 2, 2016

Dear,
Could You tell me how to using it > I want to upload to my server with this name: amazon-deal.go , but I run this file, no content display!
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment