1# GoOse
2
3*HTML Content / Article Extractor in Golang*
4
5[![Build Status](https://secure.travis-ci.org/advancedlogic/GoOse.png?branch=master)](https://travis-ci.org/advancedlogic/GoOse?branch=master)
6[![Coverage Status](https://coveralls.io/repos/advancedlogic/GoOse/badge.svg?branch=master&service=github)](https://coveralls.io/github/advancedlogic/GoOse?branch=master)
7[![Go Report Card](https://goreportcard.com/badge/github.com/advancedlogic/GoOse)](https://goreportcard.com/report/github.com/advancedlogic/GoOse)
8[![GoDoc](https://godoc.org/github.com/advancedlogic/GoOse?status.svg)](http://godoc.org/github.com/advancedlogic/GoOse)
9
10
11## Description
12
13This is a golang port of "Goose" originaly licensed to Gravity.com
14under one or more contributor license agreements.  See the NOTICE file
15distributed with this work for additional information
16regarding copyright ownership.
17
18Golang port was written by Antonio Linari
19
20Gravity.com licenses this file
21to you under the Apache License, Version 2.0 (the "License");
22you may not use this file except in compliance
23with the License.  You may obtain a copy of the License at
24
25http://www.apache.org/licenses/LICENSE-2.0
26
27Unless required by applicable law or agreed to in writing, software
28distributed under the License is distributed on an "AS IS" BASIS,
29WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30See the License for the specific language governing permissions and
31limitations under the License.
32
33## INSTALL
34
35```bash
36go get github.com/advancedlogic/GoOse
37```
38
39## HOW TO USE IT
40
41```Go
42package main
43
44import (
45	"github.com/advancedlogic/GoOse"
46)
47
48func main() {
49	g := goose.New()
50	article, _ := g.ExtractFromURL("http://edition.cnn.com/2012/07/08/opinion/banzi-ted-open-source/index.html")
51	println("title", article.Title)
52	println("description", article.MetaDescription)
53	println("keywords", article.MetaKeywords)
54	println("content", article.CleanedText)
55	println("url", article.FinalURL)
56	println("top image", article.TopImage)
57}
58```
59
60## Development - Getting started
61
62This application is written in GO language, please refere to the guides in https://golang.org for getting started.
63
64This project include a Makefile that allows you to test and build the project with simple commands.
65To see all available options:
66```bash
67make help
68```
69
70Before committing the code, please check if it passes all tests using
71```bash
72make deps
73make qa
74```
75
76## TODO
77- [ ] better organize code
78- [ ] improve "xpath" like queries
79- [ ] add other image extractions techniques (imagemagick)
80
81## THANKS TO
82```
83@Martin Angers for goquery
84@Fatih Arslan for set
85GoLang team for the amazing language and net/html
86```
87