Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Html Content / Article Extractor in Golang

License

NotificationsYou must be signed in to change notification settings

fresh8/GoOse

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTML Content / Article Extractor in Golang

Build StatusCoverage StatusGo Report CardGoDoc

Description

This is a golang port of "Goose" originaly licensed to Gravity.comunder one or more contributor license agreements. See the NOTICE filedistributed with this work for additional informationregarding copyright ownership.

Golang port was written by Antonio Linari

Gravity.com licenses this fileto you under the Apache License, Version 2.0 (the "License");you may not use this file except in compliancewith the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.

INSTALL

go get github.com/advancedlogic/GoOse

HOW TO USE IT

package mainimport ("github.com/advancedlogic/GoOse")funcmain() {g:=goose.New()article,_:=g.ExtractFromURL("http://edition.cnn.com/2012/07/08/opinion/banzi-ted-open-source/index.html")println("title",article.Title)println("description",article.MetaDescription)println("keywords",article.MetaKeywords)println("content",article.CleanedText)println("url",article.FinalURL)println("top image",article.TopImage)}

Development - Getting started

This application is written in GO language, please refere to the guides inhttps://golang.org for getting started.

This project include a Makefile that allows you to test and build the project with simple commands.To see all available options:

makehelp

Before committing the code, please check if it passes all tests using

make depsmake qa

TODO

  • better organize code
  • improve "xpath" like queries
  • add other image extractions techniques (imagemagick)

THANKS TO

@Martin Angers for goquery@Fatih Arslan for setGoLang team for the amazing language and net/html

About

Html Content / Article Extractor in Golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML95.8%
  • Go4.1%
  • Other0.1%

[8]ページ先頭

©2009-2025 Movatter.jp