<commit_before>package sync

import (
  "fmt"
  "time"
)

func Sync() {
  fmt.Println("Start sync")
  fmt.Println("Syncing readings down")
  time.Sleep(time.Duration(5)*time.Second)
  fmt.Println("Syncing highlights")
  fmt.Println("Sync done")
}
<commit_msg>Sync down readings<commit_after>package sync

import (
  "ghighlighter/models"
  "ghighlighter/readmill/readmillreadings"
)

func Sync() {
  config := models.Config()

  syncReadings(config.UserId, config.AccessToken)
}

func syncReadings(userId int, accessToken string) {
  readings := models.Readings()
  readmillReadings := readmillreadings.GetReadings(userId, accessToken)

  for _, readmillReading := range readmillReadings {
    title := readmillReading.Book.Title + " - " + readmillReading.Book.Author
    reading := models.GhReading{title, readmillReading.Id}
    readings.Add(reading)
  }
}

{'fraction_non_alphanumeric': 0.12689173457508732, 'fraction_numerical': 0.0011641443538998836, 'mean_word_length': 4.8108108108108105, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3687167', 'n_tokens_mistral': 299, 'n_tokens_neox': 289, 'n_words': 51}