<commit_before>entryModule = angular.module("entertain.io.app.entry", [])

.filter 'unsafe', ($sce) ->
  return (
    (val) ->
      return $sce.trustAsHtml val
  )

.controller 'EntryCtrl', ['$scope', '$http', '$sce'
  ($scope, $http, $sce) ->
    $scope.entries = []

    socket = io()

    $scope.updateFeed = ->
      socket.emit 'updateFeed'
      false

    $http.get('/feeds.json')
    socket.on 'feedUpdate', (feeds) ->
      console.log "feedupdate"
      for _feed_ in feeds
        feed =
          title: _feed_.title
          link: _feed_.link

        $descriptionHtml = $ _feed_.summary.replace(/'/g, '"')
        descriptionHtml = _feed_.summary.replace(/'/g, '"')

        feed.image = $descriptionHtml.find('img').first().attr('src')
        texts = descriptionHtml.match /<p>(.*?)<\/p>/g

        txt = texts.join ' '

        feed.description = txt.replace(/<(?:.|\n)*?>/gm, '')
        # console.log $(_feed_.description.replace(/'/g, '"'))
        # console.log jQuery.parseHTML(_feed_.description.replace(/'/g, '"'))

        $scope.entries.push feed
        $scope.$apply()
      return

]

module.exports = entryModule.name<commit_msg>Tidy entry-coffee<commit_after>entryModule = angular.module("entertain.io.app.entry", [])

.filter 'unsafe', ($sce) ->
  return (
    (val) ->
      return $sce.trustAsHtml val
  )

.controller 'EntryCtrl', ['$scope', '$http', '$sce'
  ($scope, $http, $sce) ->
    $scope.entries = []

    socket = io()

    $scope.updateFeed = ->
      socket.emit 'updateFeed'
      false

    $http.get('/feeds.json')
    socket.on 'feedUpdate', (feeds) ->
      console.log "feedupdate"
      for _feed_ in feeds
        feed =
          title: _feed_.title
          link: _feed_.link

        descriptionHtml = _feed_.summary.replace(/'/g, '"')
        try
          feed.image = _feed_.description.match(/src="([^\"]*)"/g)[0].replace(/src=|"/g, "")
        feed.description = _feed_.description.replace(/<(?:.|\n)*?>/gm, '')
        $scope.entries.push feed
        $scope.$apply()
      return

]

module.exports = entryModule.name
{'fraction_non_alphanumeric': 0.1914587332053743, 'fraction_numerical': 0.0004798464491362764, 'mean_word_length': 2.368336025848142, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '891877', 'n_tokens_mistral': 705, 'n_tokens_neox': 677, 'n_words': 116}