<commit_before><?php
/**
 * Description : Recuperation du tweet envoyer par l'utilisateur et insertion dans la bdd
 * @author  <NAME> <<EMAIL>>
 */
require_once('../bdd.php');
require('../modele/connexion_api.php');
session_start();

$url_tweet = explode("/", $_POST['url']);

$verification = $url_tweet[2];

if($verification != "twitter.com"){
	$reponse = "oups_twitter.com";
}else{

	$id_tweet = $url_tweet[5];

	$query='https://api.twitter.com/1.1/statuses/show.json?id='.$id_tweet;
	$content = $connection->get($query);

	$id_membre = $_SESSION['id_membre'];
	$pseudo_twitter = $content->user->name;
	$nom_twitter = $content->user->screen_name;
	$message = $content->text;
	$img = $content->user->profile_image_url;
	$date_twitter = $content->created_at;

	$rq_ajouter_tweet = $bdd->prepare("INSERT INTO tweets (id_tweet, id_tweet_tweap, pseudo_twitter, nom_twitter, id_membre, img, message, date_tweap, date_twitter, spread, vue, like, dislike) VALUES (:id_tweet, '', :pseudo_twitter, :nom_twitter, '$id_membre', :img, :message, NOW(), '$date_twitter', '0', '0', '0', '0') ");
	$rq_ajouter_tweet->execute(array(
								'id_tweet' => $id_tweet,
								'pseudo_twitter' => $pseudo_twitter,
								'nom_twitter' => $nom_twitter,
								'img' => $img,
								'message' => $message
								));
	$reponse = "ok";
}

$array['reponse'] = $reponse; // Pour la reponse ajax
echo json_encode($array);
?><commit_msg>Correction de bug lors de la recuperation des tweets<commit_after><?php
ini_set('display_errors', 1); 
ini_set('log_errors', 1); 
ini_set('error_log', dirname(__FILE__) . '/error_log.txt'); 
error_reporting(E_ALL); 
/**
 * Description : Recuperation du tweet envoyer par l'utilisateur et insertion dans la bdd
 * @author  <NAME> <<EMAIL>>
 */
require_once('../bdd.php');
require('../modele/connexion_api.php');
session_start();

$url_tweet = explode("/", $_POST['url']);

$verification = $url_tweet[2];

if($verification != "twitter.com"){
	$reponse = "oups_twitter.com";
}else{

	$id_tweet = $url_tweet[5];

	$query='https://api.twitter.com/1.1/statuses/show.json?id='.$id_tweet;
	$content = $connection->get($query);

	$id_membre = $_SESSION['id_membre'];
	$pseudo_twitter = $content->user->name;
	$nom_twitter = $content->user->screen_name;
	$message = $content->text;
	$img = $content->user->profile_image_url;
	$date_twitter = $content->created_at;

	$rq_ajouter_tweet = $bdd->prepare("INSERT INTO tweets (id_tweet, id_tweet_tweap, pseudo_twitter, nom_twitter, id_membre, img, message, date_tweap, date_twitter, spread, view, _like, dislike, outdated) VALUES (:id_tweet, '',:pseudo_twitter, :nom_twitter, '$id_membre', :img, :message, NOW(), '$date_twitter', '0', '0', '0', '0', '0') ");
	$rq_ajouter_tweet->execute(array(
								'id_tweet' => $id_tweet,
								'pseudo_twitter' => $pseudo_twitter,
								'nom_twitter' => $nom_twitter,
								'img' => $img,
								'message' => $message
								));
	$reponse = "ok";
}

$array['reponse'] = $reponse; // Pour la reponse ajax
echo json_encode($array);
?>
{'fraction_non_alphanumeric': 0.19425173439048563, 'fraction_numerical': 0.006276841757515692, 'mean_word_length': 5.056, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 43, 'https://': 2, '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': '4306615', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1125, 'n_words': 212}