<commit_before># Ingest

Ingest is a library designed to help fetch and parse podcast RSS feeds.

Installation:

```
gem 'ingest', '~> 1.0.4'
```

## Example Usage for Importing a Bunch of Episodes from a Podcast RSS Feed

```
def import_episodes_from_rss!(rss_feed_url)
  parsed_feed = Ingest::Feed.fetch_and_parse(rss_feed_url)
  parsed_feed.items.sort_by(&:published_at).each do |item|
    Rails.logger.info("Importing: #{episode.title}")
    episode = Episode.create(
      imported_guid:      item.guid,
      title:              item.title,
      short_description:  item.itunes_subtitle,
      long_description:   item.description,
      publish_at:         item.published_at,
      explicit:           item.itunes_explicit,
      keywords:           item.itunes_keywords
    )
  end
end
```<commit_msg>Fix order of creating an episode and logging it<commit_after># Ingest

Ingest is a library designed to help fetch and parse podcast RSS feeds.

Installation:

```
gem 'ingest', '~> 1.0.4'
```

## Example Usage for Importing a Bunch of Episodes from a Podcast RSS Feed

```
def import_episodes_from_rss!(rss_feed_url)
  parsed_feed = Ingest::Feed.fetch_and_parse(rss_feed_url)
  parsed_feed.items.sort_by(&:published_at).each do |item|
    episode = Episode.create(
      imported_guid:      item.guid,
      title:              item.title,
      short_description:  item.itunes_subtitle,
      long_description:   item.description,
      publish_at:         item.published_at,
      explicit:           item.itunes_explicit,
      keywords:           item.itunes_keywords
    )
    Rails.logger.info("Imported: #{episode.title}")
  end
end
```
{'fraction_non_alphanumeric': 0.09921355111917725, 'fraction_numerical': 0.003629764065335753, 'mean_word_length': 3.063882063882064, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1903682', 'n_tokens_mistral': 551, 'n_tokens_neox': 538, 'n_words': 126}