Juliette Published & Destroyed that: Difference between revisions

From Hackers & Designers
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Article
|MainNavigation=No
}}
=Justin Bieber's Purpose Generator=
=Justin Bieber's Purpose Generator=
==Justin Bieber as a fortune teller==
==Justin Bieber as a fortune teller==
                                                                               
 
                              .                                               
[[File:Justin.png]]
                        .:dO0000xlc;,...''..col::;,..                         
                      .l0KXKXX0kOOOkdkKX0xddoxkKX0NNX0O:                       
                    :OXNXXXXXK0OOOxdxkOKX0oolc:xXO00X0Okkc.                   
                .;dKNNNNX0OO000OOOOxxxxx0XxdxkOlO0dkXkddol.                   
              :NWWWWWNNXXNNNNNKkOk0KXXXKKOkddxlokxd0Kc,,,:'                   
              oWMWWNNNNWWWWWMMWWNOKXXXKK0OkxlddddOOco0x''....                 
            .OWWWNXXXXNNNWMMMWWWNKXKK0Oxxddoooodddkddkx;'.....                 
          ,0NNNNXKKXNNWN0KNNXK0kxOkk00OxdooxkO00000Oklllc.....               
        .KKNWWWWNNXXXKXKkkkxxdo:,,:lodxO0xoc;:codkO00dllOl'...               
        .kNNXNNWNXNNNNN0xkOKXOdodo:'',,lxkxxdxo:'..:xOkKx;dc...               
      .cONWNNNNWNKXNWXNX0kKWWNKdokOx:....';:c;;ll:,lddodx,;:,..               
    ,kxKWWWNWWWWXkKNNKXX0xXWWWKxdd0Kx;.....',''....lkxc::,,...               
    .XNNWWWWWWWMWWKx0NXKOKKkONMWOdOkkXXx:,,;'',:l:;;,,ddc,,. ...               
    :WWWWWWWWWWWWWW0x0XXXOkKkdkXW00XK0XNKOxdxx::clddolcxd;..  .               
    oWWWWWWWWWWMWWWNK0KKXWXKKxddx0NNNNXXNNNXX0Kkddooodocc'.                   
    .KWWWWWWWWWWWMWWXXX00XWWNXkk0kONWWNNNWNNNXKKOxol;;;'......                 
      l0XNNWWWWWWWWWWNNWK0XNWWNKKNKKNWNNXNNXKKOolc;,''.... .....               
        ONNWWWWWWWWWWWWWNKNNWWNNNNKKKKK00Oxdc;'.....'..........               
        cKNNNNWWWWWWWWWWWWWWNNNXK0Okkxdoc;,'......'','...',';l.               
          ,KNXNNNNWWWWWWNNNNXXK0Okxolc;,'...........',,,,;,,:lkl               
          .KXXNNNNNNNNXXXKKK0Okxolc:;,................',:::cld;.,'           
            ,0XNNNNNNXXKKK000Okxdool:;;,'''.............'c:::'..,00.           
            ;XNNNNXXKKK0OOOOkxddolc:,'''...............':::'.';:kK'           
              0NNNNNXXK000OOOkkkkxxdoc;;:;,'.............::;'ckOkxK.           
              xWMMMMWWNXK0OOOkkkk0KXNNXXXXK0Okxoc,.......,:c'lOKKk0           
              :XKKXXXXXXXK0OOOkOO0KKK00000Okxdl:;,.......'cl,:dok0,           
              .00KNWWWWNXK0OOOkkxxxxkOKXXNNXKK0xl;'.......:o:oclk'             
              kXNWNXNWWWWWNK0koccldOXN0k00Ox:c:;,'.......:::llo,             
              ;XNNXNNNWWWWWWXO:...';dOOOxdoc;'..........';:cll;               
                0NNXXKXXNWWWWNk;......;ldddl:;'..........,:.';                 
                ;XNNNNNNWWNNNNx:........',;;,,'.........',c                   
                dXNNNNNNNNNNXx;......'''',,,''........',;c                   
                  kXXNNNNNXXNXd,.....'::;,,,,,'.......'',:c                   
                  .OKXXXXXXNNKd,......clc:;;,''....''''';l,                   
                  .OKKXXXXKX0d;......,ccc:;,'......'',;c;                     
                    ,0KXXXNXK0kdlodl'.',;::,,'......',;::                     
                    ,0KXXNNNNK00kc'....'',,'......',;::                       
                      ;0KKXXNN0dxd;.....'''''....'';:c;                       
                      ;O00KXXXKOkxddoc:cl:;,'''',;cl'                         
                        .x0XNNWWNNX0Oxoccc:;,,,,;:l:                           
                          lO00KK00Okdolc::::::;:c:.                           
                          ;O000KKK0Okxdoccc::::.                             
                            .k0KK0Oxolc:;;,;;:.                               
                              lOOOkkxolcc:c;.                                 
                              .:coooooc;.  


With only answering 3 simple questions you can generate your own Justin Bieber life purpose.
With only answering 3 simple questions you can generate your own Justin Bieber life purpose.
Line 54: Line 12:
The algorythm picks randomly lines from those songs and generates a new combination.
The algorythm picks randomly lines from those songs and generates a new combination.
Three recurrent words have been selected and are replaced by the answers of the questions.
Three recurrent words have been selected and are replaced by the answers of the questions.
The text is automatically printed.  
The text is automatically printed.
   
 
                                                       
==The Bieber algorythm==     
==The Bieber algorythm==     


Line 88: Line 45:
               lines.append(line.strip())
               lines.append(line.strip())


''number of lines between 25 and 42''
''selection of a random number of lines between 25 and 42''
       for i in range(random.randint(25,42)):
       for i in range(random.randint(25,42)):



Latest revision as of 13:44, 24 May 2017

MainNavigation No

Justin Bieber's Purpose Generator

Justin Bieber as a fortune teller

Justin.png

With only answering 3 simple questions you can generate your own Justin Bieber life purpose.

Juliette collected the lyrics of the songs from Justin's last album Purpose. The algorythm picks randomly lines from those songs and generates a new combination. Three recurrent words have been selected and are replaced by the answers of the questions. The text is automatically printed.

The Bieber algorythm

      import sys
      
      import random
      from subprocess import call

set the variable

      var1 = raw_input("Enter your name: ")
      var2 = raw_input("A verb that defines you: ")
      var3 = raw_input("One word that inspires you: ")
      txt = 
      lines = []

lyrics file

      f = open("justinbieber.txt", "r")

image turned into text

      f2 = open("justin.txt", "r")
      justin = f2.read()
      txt += justin
      txt += "\n"
      txt += "JUSTIN BIEBER'S PURPOSE GENERATOR\n"
      txt += "\n"
      txt += "\n"
      for line in f.readlines():
              lines.append(line.strip())

selection of a random number of lines between 25 and 42

      for i in range(random.randint(25,42)):
              l = random.choice(lines)

replace function

              l = l.replace("your",var1+"'s")
              l = l.replace("you",var1)
              l = l.replace("make",var2)
              l = l.replace("I ",var3+" ")
              l = l.replace("I'",var3+"'")
              txt += l +  "\n"

print

      output = open("output.txt", "w")
      output.write(txt)
      output.close()

basic layout for the page

      call(["lp", "-d", "HP_LaserJet_8150_Series__0030C1CCDDF2_", "-o", "page-left=72", "-o", "cpi=15","-o", "lpi=9", "-o", "page-bottom=36", "-o", "page-top=28", "-o", "page-right=42", "output.txt"])

save the file in a folder

      output = open("biebs/" + str(int(round(time.time()))) + ".txt", "w")
      output.write(txt)
      output.close()