def contentThatNeedsCheckingNowGiven()

in src/main/scala/ophan/google/index/checker/Lambda.scala [32:58]


  def contentThatNeedsCheckingNowGiven(
    existingRecordsByCapiId: Map[String,AvailabilityRecord]
  )(content: ContentSummary)(implicit clock:Clock = systemUTC): Boolean =
    existingRecordsByCapiId.get(content.id).forall(content.shouldBeCheckedNowGivenExisting)

  /*
       * Logic handler
       */
  def go(): Unit = {
    val eventual = for {
      contentSummaries <- recentContentService.fetchRecentContent()
      availability <- availabilityFor(contentSummaries.toSet)
    } yield {
      println("Mostly done!")
      val allWorryinglyAbsentContent = availability.values.filter(_.contentIsCurrentlyWorryinglyAbsentFromGoogle())
      //println(f"Missing from Google index: ${100f*allWorryinglyAbsentContent.size/successfulIndexStateChecks}%.1f%%")
      for {
        worryinglyAbsentContent <- allWorryinglyAbsentContent.toSeq.sortBy(_.contentSummary.firstPublished)
      } {
        val content = worryinglyAbsentContent.contentSummary
        println(s"${content.timeSinceUrlWentPublic().toMinutes}mins ${content.ophanUrl}\n${content.googleSearchUiUrl}\n")
      }
      // checkReports
    }

    Await.result(eventual , 10.seconds)
  }