Actions

Page web

« ERG::Code-2018-2 » : différence entre les versions

De erg

Ergbot (discussion | contributions)
Aucun résumé des modifications
Ergbot (discussion | contributions)
Aucun résumé des modifications
 
(Une version intermédiaire par le même utilisateur non affichée)
Ligne 2 : Ligne 2 :
|URL=http://curlybraces.be/wiki/index.php/ERG::Code-2018-2
|URL=http://curlybraces.be/wiki/index.php/ERG::Code-2018-2
|Title=ERG::Code-2018-2
|Title=ERG::Code-2018-2
|Updated=2018-12-19 22:46:55
|Updated=2019-05-16 09:23:13
|Site=Curlybraces
|Site=Curlybraces
|Thumbnail=
|Thumbnail=
Ligne 13 : Ligne 13 :


[http://curlybraces.be/wiki/Typoem_-_Quentin_Lamouroux Typoem - Quentin Lamouroux]
[http://curlybraces.be/wiki/Typoem_-_Quentin_Lamouroux Typoem - Quentin Lamouroux]
[http://curlybraces.be/wiki/La_f%C3%A9tichisation_de_l%27Objet_-_Quentin_Lamouroux La fétichisation de l'Objet - Quentin Lamouroux]


[http://curlybraces.be/wiki/Programme_-_Clara_Sambot programme - Clara Sambot]
[http://curlybraces.be/wiki/Programme_-_Clara_Sambot programme - Clara Sambot]
Ligne 26 : Ligne 28 :
[http://curlybraces.be/wiki/Oram_-_Simon_Bouvier oram - Simon Bouvier]
[http://curlybraces.be/wiki/Oram_-_Simon_Bouvier oram - Simon Bouvier]


[http://curlybraces.be/wiki/index.php?title=P(A)Rojet_-_Anthony_Pauwels&action=edit&redlink=1 p(A)Rojet - Anthony Pauwels]
[http://curlybraces.be/wiki/P(A)Rojet_-_Anthony_Pauwels p(A)Rojet - Anthony Pauwels]
 
[http://curlybraces.be/wiki/Impression_Alternative_-_Anthony_Pauwels Impression Alternative - Anthony Pauwels]


[http://curlybraces.be/wiki/Trame92_-_Hugo_Delpluque Trame92 - Hugo Delpluque]
[http://curlybraces.be/wiki/Trame92_-_Hugo_Delpluque Trame92 - Hugo Delpluque]
Ligne 38 : Ligne 42 :
[http://curlybraces.be/wiki/Partition_Graphique_-_Jade_Rouanet Partition Graphique - Jade Rouanet]
[http://curlybraces.be/wiki/Partition_Graphique_-_Jade_Rouanet Partition Graphique - Jade Rouanet]


Récupérée de « http://curlybraces.be/wiki/index.php?title=ERG::Code-2018-2&oldid=3055 »
[http://curlybraces.be/wiki/Sous-titre_-_Hugo Sous-titre - Hugo]
 
[http://curlybraces.be/wiki/index.php?title=Histoire_de_l%27%C3%A9cran_-_Fr%C3%A9d%C3%A9ric_Jaman&action=edit&redlink=1 Histoire de l'écran - Frédéric Jaman]
 
== Scripts démos ==
 
=== Un script php pour analyser un fichier json de conversations Messenger ===
 
<pre class="de1">function fixBadUnicodeForJson($str) {
    $str = preg_replace_callback(
    '/\\\\u00([0-9a-f]{2})\\\\u00([0-9a-f]{2})\\\\u00([0-9a-f]{2})\\\\u00([0-9a-f]{2})/',
    function($matches) { return chr(hexdec(&quot;$1&quot;)).chr(hexdec(&quot;$2&quot;)).chr(hexdec(&quot;$3&quot;)).chr(hexdec(&quot;$4&quot;)); },
    $str
    );
    $str = preg_replace_callback(
    '/\\\\u00([0-9a-f]{2})\\\\u00([0-9a-f]{2})\\\\u00([0-9a-f]{2})/',
    function($matches) { return chr(hexdec(&quot;$1&quot;)).chr(hexdec(&quot;$2&quot;)).chr(hexdec(&quot;$3&quot;)); },
    $str
    );
    $str = preg_replace_callback(
    '/\\\\u00([0-9a-f]{2})\\\\u00([0-9a-f]{2})/',
    function($matches) { return chr(hexdec(&quot;$1&quot;)).chr(hexdec(&quot;$2&quot;)); },
    $str
    );
    $str = preg_replace_callback(
    '/\\\\u00([0-9a-f]{2})/',
    function($matches) { return chr(hexdec(&quot;$1&quot;)); },
    $str
    );
    return $str;
}
 
function textConverter($str){
    $str =  utf8_decode(fixBadUnicodeForJson($str));
    return $str;
}
 
 
 
 
 
 
    $data = file_get_contents(&quot;tiina.json&quot;);
    $data_traitee = json_decode($data);
    //echo $data_data_traitee;
    //print_r($data_traitee);
    //echo $data_traitee-&gt;participants[0]-&gt;name;
 
 
    echo $data_traitee-&gt;messages[5]-&gt;content;
 
    foreach($data_traitee-&gt;messages as $message){
        //echo '&lt;p class=&quot;message&quot;&gt;'.textConverter($message-&gt;content).'&lt;/p&gt;';
        //echo &quot;&lt;p class=\&quot;message\&quot;&gt;$message-&gt;content&lt;/p&gt;&quot;;
 
        $test1 = strpos($message-&gt;content, 'non');
        $test2 = strpos($message-&gt;content, 'pas');
 
        if($test1 != false &amp;&amp; $test2 != false){
            echo '&lt;p class=&quot;message&quot;&gt;'.textConverter($message-&gt;content).'&lt;/p&gt;';
        }
 
    }
 
 
?&gt;</pre>
Récupérée de « http://curlybraces.be/wiki/index.php?title=ERG::Code-2018-2&oldid=3344 »

Dernière version du 17 mai 2019 à 02:11

Source (url) http://curlybraces.be/wiki/index.php/ERG::Code-2018-2
Site satellite Curlybraces
Date 2019-05-16 09:23:13

De {}

Aller à : navigation, rechercher

Projets

Typoem - Quentin Lamouroux

La fétichisation de l'Objet - Quentin Lamouroux

programme - Clara Sambot

.IMG

TYPO3000 - Nathan Laurent

Destroy prog. zoeflts

Campix_alice

oram - Simon Bouvier

p(A)Rojet - Anthony Pauwels

Impression Alternative - Anthony Pauwels

Trame92 - Hugo Delpluque

Framing - Jean Cardin

Máquina do tempo - Sofia Erzini

test

Partition Graphique - Jade Rouanet

Sous-titre - Hugo

Histoire de l'écran - Frédéric Jaman

Scripts démos

Un script php pour analyser un fichier json de conversations Messenger

function fixBadUnicodeForJson($str) {
    $str = preg_replace_callback(
    '/\\\\u00([0-9a-f]{2})\\\\u00([0-9a-f]{2})\\\\u00([0-9a-f]{2})\\\\u00([0-9a-f]{2})/',
    function($matches) { return chr(hexdec("$1")).chr(hexdec("$2")).chr(hexdec("$3")).chr(hexdec("$4")); },
    $str
    );
    $str = preg_replace_callback(
    '/\\\\u00([0-9a-f]{2})\\\\u00([0-9a-f]{2})\\\\u00([0-9a-f]{2})/',
    function($matches) { return chr(hexdec("$1")).chr(hexdec("$2")).chr(hexdec("$3")); },
    $str
    );
    $str = preg_replace_callback(
    '/\\\\u00([0-9a-f]{2})\\\\u00([0-9a-f]{2})/',
    function($matches) { return chr(hexdec("$1")).chr(hexdec("$2")); },
    $str
    );
    $str = preg_replace_callback(
    '/\\\\u00([0-9a-f]{2})/',
    function($matches) { return chr(hexdec("$1")); },
    $str
    );
    return $str;
}
 
function textConverter($str){
    $str =  utf8_decode(fixBadUnicodeForJson($str));
    return $str;
}
 
 
 
 
 
 
    $data = file_get_contents("tiina.json");
    $data_traitee = json_decode($data);
    //echo $data_data_traitee;
    //print_r($data_traitee);
    //echo $data_traitee->participants[0]->name;
 
 
    echo $data_traitee->messages[5]->content;
 
    foreach($data_traitee->messages as $message){
        //echo '<p class="message">'.textConverter($message->content).'</p>';
        //echo "<p class=\"message\">$message->content</p>";
 
        $test1 = strpos($message->content, 'non');
        $test2 = strpos($message->content, 'pas');
 
        if($test1 != false && $test2 != false){
            echo '<p class="message">'.textConverter($message->content).'</p>';
        }
 
    }
 
 
?>

Récupérée de « http://curlybraces.be/wiki/index.php?title=ERG::Code-2018-2&oldid=3344 »