<commit_before>module Podio
  module News
    include Podio::ResponseWrapper
    extend self

    def find_stream()
      Podio.connection.get("/news/stream").body
    end

    def get_news_redirect(news_id)
      response = Podio.connection.get("/news/#{news_id}/redirect")
      response.body['link']
    end

	def delete(news_id)
		Podio.connection.delete("/news/#{news_id}")
	end

    def unsubscribe_entry(news_id)
      Podio.connection.post do |req|
        req.url "/news/#{news_id}/unsubscribe"
      end
    end

    def create(attributes)
      response = Podio.connection.post do |req|
        req.url '/news/'
        req.body = attributes
      end

      response.body['news_id']
    end

    def update(id, attributes)
      response = Podio.connection.put do |req|
        req.url "/news/#{id}"
        req.body = attributes
      end

      response.status
    end

    def find(id, options={})
      member Podio.connection.get("/news/#{id}").body
    end

    def find_visible
      list Podio.connection.get("/news/").body
    end

    def find_all
      list Podio.connection.get("/news/").body
    end

    def find_all_by_locale(locale)
      list Podio.connection.get('/news/?locale=#{locale}').body
    end

    def find_all_by_target_group(target_group)
      list Podio.connection.get('/news/?target_group=#{target_group}').body
    end

    def find_all_by_locale_and_group(locale, group)
      list Podio.connection.get('/news/?locale=#{locale}?target_group=#{group}').body
    end

  end
end<commit_msg>Update get news redirect with type param for click stats. Fixes #589332<commit_after>module Podio
  module News
    include Podio::ResponseWrapper
    extend self

      def find_stream()
        Podio.connection.get("/news/stream").body
      end

      def get_news_redirect(news_id, type=nil)
        type = type.presence || 'stream'
        response = Podio.connection.get("/news/#{news_id}/redirect?type=#{type}")
        response.body['link']
      end

      def delete(news_id)
        Podio.connection.delete("/news/#{news_id}")
      end

      def unsubscribe_entry(news_id)
        Podio.connection.post do |req|
          req.url "/news/#{news_id}/unsubscribe"
        end
      end

      def create(attributes)
        response = Podio.connection.post do |req|
          req.url '/news/'
          req.body = attributes
        end
        response.body['news_id']
      end

      def update(id, attributes)
        response = Podio.connection.put do |req|
          req.url "/news/#{id}"
          req.body = attributes
        end

        response.status
      end

      def find(id, options={})
        member Podio.connection.get("/news/#{id}").body
      end

      def find_visible
        list Podio.connection.get("/news/").body
      end

      def find_all
        list Podio.connection.get("/news/").body
      end

      def find_all_by_locale(locale)
        list Podio.connection.get('/news/?locale=#{locale}').body
      end

      def find_all_by_target_group(target_group)
        list Podio.connection.get('/news/?target_group=#{target_group}').body
      end

      def find_all_by_locale_and_group(locale, group)
        list Podio.connection.get('/news/?locale=#{locale}?target_group=#{group}').body
      end

    end
end
{'fraction_non_alphanumeric': 0.12109256449165402, 'fraction_numerical': 0.0018209408194233688, 'mean_word_length': 2.3735926305015353, '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': '6924195', 'n_tokens_mistral': 1039, 'n_tokens_neox': 999, 'n_words': 198}