# Script Allociné

**URL:** <https://www.debian-fr.org/t/script-allocine/57516>\
**Category:** Programmation\
**Created:** [Février 21, 2016, 2:45 UTC](https://www.debian-fr.org/t/script-allocine/57516 "2016-02-21T14:45:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![M3t4linux](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@M3t4linux](https://www.debian-fr.org/u/M3t4linux)\
**Post date:** [Février 21, 2016, 2:45 UTC](https://www.debian-fr.org/t/script-allocine/57516/1 "2016-02-21T14:45:59Z")

</div>

Ce script tourne sur mon serveur pour afficher les dernières sorties DVD du site Allociné

` #!/bin/bash
  2 film=false
  3 titre=""
  4 url='http://www.allocine.fr/dvd/agenda/'
  5 out='/var/www/genpashiro.dyndns.org/dvd.html'
  6 
  7 exec 1<> "$out"
  8 
  9 cat <<EOF
 10 <!DOCTYPE html>
 11 <html lang="fr">
 12 <head>
 13 <meta charset="utf-8">
 14 <title>Agenda des sorties DVD</title>
 15 <h3> Sorties DVD de la semaine - <a href="http://www.allocine.fr/dvd/agenda/">Source</a></h3>
 16 <style type="text/css">
 17 #introduction
 18 {
 19 font-weight: bold;
 20 }
 21 body {
 22 background-color: #000000;
 23 color: #00ff00;
 24 font-family: matrix;
 25 }  
 26 a {
 27 color: #356e31;
 28 text-decoration: none;
 29 }
 30 
 31 a:visited
 32 {
 33 color: #769773;
 34 }
 35 
 36 a:hover {
 37 color: #ff0000;
 38 }
 39 </style>
 40 </head>
 41 
 42 <body>
 43 EOF
 44 while read
 45 do
 46 case "${REPLY}" in
 47 *picturezone*)
 48 film=true
 49 ;;
 50 De\ \<a*)
 51 auteur=$(IFS='<>' infos=( ${REPLY} ); echo ${infos[2]})
 52 ;;
 53 Avec\ \<a*)
 54 acteurs="$(sed 's/<a[^<]*>//g; s#</a>##g' <<< "${REPLY#Avec }")"
 55 ;;
 56 *Date\ de\ sortie*)
 57 dateSortie="${REPLY#*: }"
 58 ;;
 59 *)
 60 if ${film} && [[${REPLY} != *\<*\>*]]
 61 then
 62 if [[! ${titre}]]
 63 then
 64 titre="${REPLY}"
 65 elif [[! ${typeFilm}]]
 66 then
 67 typeFilm="${REPLY}"
 68 else
 69 cat <<EOF
 70 <div id="introduction">${titre}</div>
 71 Genre=${typeFilm}<br/>
 72 Date Sortie=${dateSortie}<br/>
 73 De=${auteur}<br/>
 74 Avec=${acteurs}<br/>
 75 Résumé=${REPLY}<br/>
 76 <br/>
 77 EOF
 78 film=false
 79 titre=""
 80 typeFilm=""
 81 fi
 82 fi
 83 ;;
 84 esac
 85 done < <(wget -qO- "$url")
 86 echo '</body></html>'
 87 
 88 exec 1>&-
 89 
 90 true`

Depuis quelques jours, l’affichage dans le fichier généré dvd.html est incomplet, voir ici [https://genpashiro.dyndns.org/dvd.html](https://genpashiro.dyndns.org/dvd.html)

Que peut il se passer??

---

<div class="post-metadata">

**Author:** ![MisterFreez](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@MisterFreez](https://www.debian-fr.org/u/MisterFreez)\
**Post date:** [Février 21, 2016, 2:46 UTC](https://www.debian-fr.org/t/script-allocine/57516/2 "2016-02-21T14:46:02Z")

</div>

Le format HTML doit avoir changé. Parce que par exemple tu cherche l’auteur des films dans une ligne qui contient “De \*\<a” alors que dans ce que je vois maintenant c’est :

```auto
De
<a href='/personne/fichepersonne_gen_cpersonne=208674.html' title='Jay Oliva'>Jay Oliva</a>
```

---

<div class="post-metadata">

**Author:** ![thuban](https://www.debian-fr.org/user_avatar/www.debian-fr.org/thuban/32/4177_2.png) [@thuban](https://www.debian-fr.org/u/thuban)\
**Post date:** [Février 21, 2016, 2:46 UTC](https://www.debian-fr.org/t/script-allocine/57516/3 "2016-02-21T14:46:05Z")

</div>

Pour éviter ces soucis de formats de page html, existe-t-il un accès en RSS équivalent que tu pourrais utiliser?

---

<div class="post-metadata">

**Author:** ![M3t4linux](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@M3t4linux](https://www.debian-fr.org/u/M3t4linux)\
**Post date:** [Février 21, 2016, 2:46 UTC](https://www.debian-fr.org/t/script-allocine/57516/4 "2016-02-21T14:46:05Z")

</div>

il n’y a pas de flux rss pour les sorties DVD malheureusement…

[http://www.allocine.fr/xml/rss/#video](http://www.allocine.fr/xml/rss/#video)

---

<div class="post-metadata">

**Author:** ![MisterFreez](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@MisterFreez](https://www.debian-fr.org/u/MisterFreez)\
**Post date:** [Février 21, 2016, 2:46 UTC](https://www.debian-fr.org/t/script-allocine/57516/5 "2016-02-21T14:46:06Z")

</div>

> [@thuban](#):
>
> Pour éviter ces soucis de formats de page html, existe-t-il un accès en RSS équivalent que tu pourrais utiliser?

Je suis allé voir s’ils avaient des webservices. Ils en ont mais ils font tout pour qu’on ne puisse pas les utiliser.  
[wiki.gromez.fr/dev/api/allocine\_v3](http://wiki.gromez.fr/dev/api/allocine_v3)

J’ai un peu essayé ce matin, mais j’ai pas encore réussi.
