Giter Club home page Giter Club logo

feeder's People

Contributors

dependabot-preview[bot] avatar p1ass avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tomoyat1 honai

feeder's Issues

feeder.Crawl()にCrawlerのスライスを展開して渡すとエラーが出る

複数のCrawlerを格納するスライスを、feeder.Crawl(slice...)と展開して引数に渡すとエラーが出ます。単体でCrawlerを引数に渡し、ループさせると問題なく動作するためRSS側の問題ではないような気がします。

// JSONを受け取り、それをパースしてCrawlerを作りフィードアイテムを取得する
func GetFeeds(rawJSON []byte) []*feeder.Item {
	var data []feedType
	var combinedItem []feeder.Crawler
	json.Unmarshal(rawJSON, &data)
	for _, item := range data {
		var rss feeder.Crawler
                 // item.Valueは取得するRSSのURL
		rss = feeder.NewRSSCrawler(item.Value)
                // combinedItemがCrawlerを格納するスライスになる
		combinedItem = append(combinedItem, rss)
	}
	var feedItem []*feeder.Item
        // 以下のようにスライスを展開して渡すとエラーが出る
        feedItem, err := feeder.Crawl(combinedItem...)	
        ErrorHandling(err)

        // 以下のようにループを回し、単体のCrawler(ここではitem)をfeeder.Crawl()の引数に渡すと正常に動作する
	/* for  _, item := range combinedItem {
		individualItem, err := feeder.Crawl(item)
		ErrorHandling(err)
		feedItem = append(feedItem, individualItem...)
	} */
	return feedItem
}

エラーメッセージ

failed to crawl items: Failed to decode response body.: EOF
exit status 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.