<commit_before><?php 
if(isset($_GET['code'])){
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, "https://api.instagram.com/oauth/access_token");
  $data = array('client_id' => 'e0f27ab07f6a47cf9a668fd86db4da5d', 'client_secret' => '7a1d9a5d041242f9844cb43004c5a64c','grant_type' => 'authorization_code', 'redirect_uri' => 'http://viniciusbueno.com/cmo/socire/app/core/services/instagram.php', 'code' => $_GET['code']);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $output = json_decode(curl_exec($ch));
  $access_token = $output->access_token;
  curl_close($ch);
  $url = 'http://viniciusbueno.com/cmo/socire/core/app/services/instagram.php?access_token='.$access_token.'&instagram_id='.$output->user->id.'&profile_picture='.$output->user->profile_picture.'&instagram_username='.$output->user->username;
  $url = str_replace(".jpg", "", $url);
  $url = str_replace("https://", "", $url);
  echo '<META http-equiv="refresh" content="1;URL='.$url.'"> ';
}
else{
?>
<script src="../../plugins/jQuery/jQuery-2.1.4.min.js"></script>
<script src="../../dist/js/util.js"></script>
<script type="text/javascript">
var params = util.url.getParameters();
$.ajax({
  url: '../services.php',
  type: 'POST',
  data:{
    service: 'instagram',<commit_msg>Update on Instagram API redirect<commit_after><?php 
if(isset($_GET['code'])){
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, "https://api.instagram.com/oauth/access_token");
  $data = array('client_id' => 'e0f27ab07f6a47cf9a668fd86db4da5d', 'client_secret' => '7a1d9a5d041242f9844cb43004c5a64c','grant_type' => 'authorization_code', 'redirect_uri' => 'http://socire.com/app/core/services/instagram.php', 'code' => $_GET['code']);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $output = json_decode(curl_exec($ch));
  $access_token = $output->access_token;
  curl_close($ch);
  $url = 'http://socire.com/app/core/services/instagram.php?access_token='.$access_token.'&instagram_id='.$output->user->id.'&profile_picture='.$output->user->profile_picture.'&instagram_username='.$output->user->username;
  $url = str_replace(".jpg", "", $url);
  $url = str_replace("https://", "", $url);
  echo '<META http-equiv="refresh" content="1;URL='.$url.'"> ';
}
else{
?>
<script src="../../plugins/jQuery/jQuery-2.1.4.min.js"></script>
<script src="../../dist/js/util.js"></script>
<script type="text/javascript">
var params = util.url.getParameters();
$.ajax({
  url: '../services.php',
  type: 'POST',
  data:{
    service: 'instagram',
{'fraction_non_alphanumeric': 0.22669245647969052, 'fraction_numerical': 0.03249516441005803, 'mean_word_length': 5.859416445623342, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 41, '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': '6936012', 'n_tokens_mistral': 1009, 'n_tokens_neox': 966, 'n_words': 119}