Pouvez vous me traduire ce code Python en PHP ?
Résolu
Rayfi
Messages postés
205
Date d'inscription
Statut
Membre
Dernière intervention
-
fabrevirgil Messages postés 188 Date d'inscription Statut Membre Dernière intervention -
fabrevirgil Messages postés 188 Date d'inscription Statut Membre Dernière intervention -
#!/usr/bin/python
from random import randint, choice
from requests import get
from re import findall
maximum = (6251476 - 1) / 25
nbPage = randint(0, maximum) * 25 + 1
liste = get('http://ws.jeuxvideo.com/forums/0-50-0-1-0-%d-0-0.xml' % nbPage, auth=('appandr','e32!cdf'))
liste = findall('<lien_topic>jv:/(.+?)xml<', liste.content)
print 'Location: http://www.jeuxvideo.com' + choice(liste) + '.htm'
print "Content-type: text/html"
print
Merci si vous le pouvez.
from random import randint, choice
from requests import get
from re import findall
maximum = (6251476 - 1) / 25
nbPage = randint(0, maximum) * 25 + 1
liste = get('http://ws.jeuxvideo.com/forums/0-50-0-1-0-%d-0-0.xml' % nbPage, auth=('appandr','e32!cdf'))
liste = findall('<lien_topic>jv:/(.+?)xml<', liste.content)
print 'Location: http://www.jeuxvideo.com' + choice(liste) + '.htm'
print "Content-type: text/html"
Merci si vous le pouvez.
A voir également:
- Pouvez vous me traduire ce code Python en PHP ?
- Code ascii - Guide
- Citizen code python avis - Accueil - Outils
- Code puk bloqué - Guide
- Comment traduire un site en français - Guide
- Comment déverrouiller un téléphone quand on a oublié le code - Guide