示例#1
0
func getArticle(aURL string) (article string, err error) {
	var (
		lA  *lenta.Article
		doc *goquery.Document
	)

	log.Println("Fetching article from the URL: ", aURL)

	if doc, err = goquery.NewDocument(aURL); err != nil {
		return
	}

	if lA, err = lenta.Format(doc); err != nil {
		return
	}

	lA.AppendSource(aURL)

	if article, err = lA.ToBBCode(); err != nil {
		return
	}

	article += "\n [url='http://strawpoll.me/6040103']Голосуем куда засунуть ботов![/url]"

	return
}
示例#2
0
func getArticle(aURL string) (article string, err error) {
	var (
		lA  *lenta.Article
		doc *goquery.Document
	)

	log.Println("Fetching article from the URL: ", aURL)

	if doc, err = goquery.NewDocument(aURL); err != nil {
		return
	}

	if lA, err = lenta.Format(doc); err != nil {
		return
	}
	lA.AppendSource(aURL)
	lA.AppendFMob()

	if article, err = lA.ToBBCode(); err != nil {
		return
	}

	return
}