<commit_before><?php
class Twitter extends Joobsbox_Plugin_Base {
	public function init() {
		
	}
	
	function event_job_accepted($jobId) {
		$jobData = $this->getModel("Jobs")->fetchJobById($jobId);
		
		// Make a tiny URL
		$url = "http://omani.ac/api/shorten.xml";
		$ch = curl_init($url);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_POSTFIELDS, "url=http://" . $_SERVER['SERVER_NAME'] . urlencode($this->baseUrl . '/job/' . $this->_helper->MakeLink($jobData['Title']) . "-" . $jobData['ID'] . '.html'));
		
		$xml = curl_exec($ch);
		curl_close($ch);
		
		$xml = new SimpleXMLElement($xml);
		if($xml->status == "OK") {
			$url = $xml->url[0];
		}
		
		// Now post to Twitter
		$ch = curl_init();
		
		curl_setopt($ch, CURLOPT_URL, "http://twitter.com/statuses/update.json?status=" . urlencode($jobData['Title'] . ' @ ' . $jobData['Company'] . ' - ' . $jobData['Location'] . '   ' . $url));
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_USERPWD, "<PASSWORD>");
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		
		curl_exec($ch);
		curl_close($ch);
	}
}<commit_msg>Removed hardcoded twitter username and password<commit_after><?php
class Twitter extends Joobsbox_Plugin_Base {
	public function init() {
		
	}
	
	function event_job_accepted($jobId) {
	  /******* CONFIGURATION **********/
	  $username = "";
	  $password = "";
	  /********************************/
	  
	  if(!(strlen($username) && strlen($password))) { // Don't even try to post it without username and pass
	    return;
	  }
	  
		$jobData = $this->getModel("Jobs")->fetchJobById($jobId);
		
		// Make a tiny URL
		$url = "http://omani.ac/api/shorten.xml";
		$ch = curl_init($url);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_POSTFIELDS, "url=http://" . $_SERVER['SERVER_NAME'] . urlencode($this->baseUrl . '/job/' . $this->_helper->MakeLink($jobData['Title']) . "-" . $jobData['ID'] . '.html'));
		
		$xml = curl_exec($ch);
		curl_close($ch);
		
		$xml = new SimpleXMLElement($xml);
		if($xml->status == "OK") {
			$url = $xml->url[0];
		}
		
		// Now post to Twitter
		$ch = curl_init();
		
		curl_setopt($ch, CURLOPT_URL, "http://twitter.com/statuses/update.json?status=" . urlencode($jobData['Title'] . ' @ ' . $jobData['Company'] . ' - ' . $jobData['Location'] . '   ' . $url));
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		
		curl_exec($ch);
		curl_close($ch);
	}
}
{'fraction_non_alphanumeric': 0.21252302025782688, 'fraction_numerical': 0.0014732965009208103, 'mean_word_length': 4.124528301886793, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '636112', 'n_tokens_mistral': 1138, 'n_tokens_neox': 982, 'n_words': 165}