<commit_before><?php
class IdenticaBridge extends BridgeAbstract{

	private $request;

	public function loadMetadatas() {

		$this->maintainer = "mitsukarenai";
		$this->name = "Identica Bridge";
		$this->uri = "https://identi.ca/";
		$this->description = "Returns user timelines";

        $this->parameters[] = array(
            'u'=>array(
                'name'=>'username',
                'required'=>true
            )
        );

	}

    public function collectData(){
        $param=$this->parameters[$this->queriedContext];
        $html = '';
        if (isset($param['u']['value'])) {   /* user timeline mode */
        	$this->request = $param['u']['value'];
            $html = $this->getSimpleHTMLDOM('https://identi.ca/'.urlencode($this->request)) or $this->returnServerError('Requested username can\'t be found.');
        }
        else {
            $this->returnClientError('You must specify an Identica username (?u=...).');
        }

        foreach($html->find('li.major') as $dent) {
            $item = array();
            $item['uri'] = html_entity_decode($dent->find('a', 0)->href);	// get dent link
            $item['timestamp'] = strtotime($dent->find('abbr.easydate', 0)->plaintext);	// extract dent timestamp
            $item['content'] = trim($dent->find('div.activity-content', 0)->innertext);	// extract dent text
            $item['title'] = $param['u']['value'] . ' | ' . $item['content'];
            $this->items[] = $item;
        }
    }

    public function getName(){
        return (!empty($this->request) ? $this->request .' - ' : '') .'Identica Bridge';
    }

    public function getURI(){
        return 'https://identica.com';
    }

    public function getCacheDuration(){
        return 300; // 5 minutes
    }
}<commit_msg>[IdenticaBridge] remove useless code and fix getURI()<commit_after><?php
class IdenticaBridge extends BridgeAbstract{

	public function loadMetadatas() {

		$this->maintainer = "mitsukarenai";
		$this->name = "Identica Bridge";
		$this->uri = "https://identi.ca/";
		$this->description = "Returns user timelines";

        $this->parameters[] = array(
            'u'=>array(
                'name'=>'username',
                'required'=>true
            )
        );

	}

    public function collectData(){
        $html = '';
        $html = $this->getSimpleHTMLDOM($this->getURI())
            or $this->returnServerError('Requested username can\'t be found.');

        foreach($html->find('li.major') as $dent) {
            $item = array();
            $item['uri'] = html_entity_decode($dent->find('a', 0)->href);	// get dent link
            $item['timestamp'] = strtotime($dent->find('abbr.easydate', 0)->plaintext);	// extract dent timestamp
            $item['content'] = trim($dent->find('div.activity-content', 0)->innertext);	// extract dent text
            $item['title'] = $param['u']['value'] . ' | ' . $item['content'];
            $this->items[] = $item;
        }
    }

    public function getName(){
        $param=$this->parameters[$this->queriedContext];
        return $param['u']['value'] .' - Identica Bridge';
    }

    public function getURI(){
        $param=$this->parameters[$this->queriedContext];
        return $this->uri.urlencode($param['u']['value']);
    }

    public function getCacheDuration(){
        return 300; // 5 minutes
    }
}
{'fraction_non_alphanumeric': 0.1869047619047619, 'fraction_numerical': 0.004166666666666667, 'mean_word_length': 2.4401228249744116, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 52, 'https://': 4, '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': '5078498', 'n_tokens_mistral': 1018, 'n_tokens_neox': 954, 'n_words': 193}