<commit_before>package plugins

import . "github.com/osmano807/joker/interfaces"

type Imgur struct {
	name string
}

func (p *Imgur) Name() string {
	return p.name
}

func (p *Imgur) Init() {
	p.name = "Imgur"
}

func (p *Imgur) Handle(il *InputLine) (ol *OutputLine) {
	ol = &OutputLine{}

	ol.ChannelId = il.ChannelId

	if il.URL.Host != "i.imgur.com" {
		ol.Result = NO_CHANGE
		return
	}

	ol.Result = NEW_STOREID
	il.URL.Path = removeExtension(il.URL.Path)
	il.URL.Host = JOKER_PREFIX + "/" + il.URL.Host
	ol.StoreId = il.URL.String()

	return
}<commit_msg>Remove querystring info from Imgur urls<commit_after>package plugins

import . "github.com/osmano807/joker/interfaces"

type Imgur struct {
	name string
}

func (p *Imgur) Name() string {
	return p.name
}

func (p *Imgur) Init() {
	p.name = "Imgur"
}

func (p *Imgur) Handle(il *InputLine) (ol *OutputLine) {
	ol = &OutputLine{}

	ol.ChannelId = il.ChannelId

	if il.URL.Host != "i.imgur.com" {
		ol.Result = NO_CHANGE
		return
	}

	ol.Result = NEW_STOREID
	il.URL.Path = removeExtension(il.URL.Path)
	il.URL.Host = JOKER_PREFIX + "/" + il.URL.Host
	il.URL.RawQuery = ""
	ol.StoreId = il.URL.String()

	return
}
{'fraction_non_alphanumeric': 0.15076660988074958, 'fraction_numerical': 0.005110732538330494, 'mean_word_length': 3.554263565891473, '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': '2308022', 'n_tokens_mistral': 499, 'n_tokens_neox': 482, 'n_words': 104}