@@ 79,15 79,20 @@ func mastodonTask(c *mastodon.Client, feedURL string, ignore []string) {
// gets feeds
feeds := parseFeed(feedURL)
- // selects a ramdon item from the feed
- //rand.Seed(time.Now().UnixNano())
- //randToot := feeds[rand.Intn(len(feeds))]
var randToot theFeed
var check int
+ // Algorith made up on the fly to
// check if item contains ignore words
+ // it has to check for each of the words but stop when
+ // one of the words matches or
+ // it has already check the lenght of the string slice of ignored words
+ // then it ask for another rss item and repeats the check
+ // if no words are matched in the current item then randToot keeps its value
+ // and continues - rek2
for len(randToot.Title) <= 0 {
+ // selects a ramdon item from the feed
rand.Seed(time.Now().UnixNano())
randToot = feeds[rand.Intn(len(feeds))]
@@ 105,7 110,7 @@ func mastodonTask(c *mastodon.Client, feedURL string, ignore []string) {
}
}
randToot = theFeed{}
- log.Println("salio del for loop en range")
+ log.Println("Ignored item against ignored words")
}
}
// creates the formating of the toot