UrlMatchs.php 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. namespace Muzich\CoreBundle\Factory;
  3. use Muzich\CoreBundle\Entity\Element;
  4. class UrlMatchs
  5. {
  6. /*
  7. * Si il y a un Element::TYPE_NOTMATCH le placer en début de tableau !
  8. */
  9. public static $jamendo = array(
  10. Element::TYPE_TRACK => array(
  11. // http://www.jamendo.com/fr/track/894974
  12. "#^\/[a-zA-Z0-9_-]+\/track\/([0-9]+)#" => 1,
  13. // http://www.jamendo.com/fr/track/347602/come-come
  14. "#^\/[a-zA-Z0-9_-]+\/track\/([0-9]+)\/.#" => 1
  15. ),
  16. Element::TYPE_ALBUM => array(
  17. // http://www.jamendo.com/fr/album/3409
  18. "#^\/[a-zA-Z0-9_-]+\/album\/([0-9]+)#" => 1,
  19. // http://www.jamendo.com/fr/list/a45666/proceed-positron...
  20. "#^\/[a-zA-Z0-9_-]+\/list\/a([0-9]+)\/.#" => 1
  21. )
  22. );
  23. public static $soundcloud = array(
  24. Element::TYPE_NOTMATCH => array(
  25. "#\/search\?q#" => null
  26. ),
  27. Element::TYPE_OTHER => array(
  28. // http://soundcloud.com/matas/sets/library-project
  29. "#^\/[a-zA-Z0-9_-]+\/sets\/[a-zA-Z0-9_-]+#" => null,
  30. // http://soundcloud.com/noisia/black-sun-empire-noisia-feed
  31. // http://soundcloud.com/user4818423/mechanika-crew-andrew-dj-set
  32. "#^\/[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+#" => null
  33. )
  34. );
  35. public static $dailymotion = array(
  36. Element::TYPE_OTHER => array(
  37. // http://dailymotion.com/video/xnqcwx_le-nazisme-dans-le-couple_fun#hp-v-v2
  38. "#\/(video\/)([a-zA-Z0-9]+)([a-zA-Z0-9_-]*)#" => 2
  39. )
  40. );
  41. public static $deezer = array(
  42. Element::TYPE_ALBUM => array(
  43. // http://www.deezer.com/fr/music/pantera/far-beyond-driven-80398
  44. "#^\/[a-zA-Z_-]+\/music\/[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+-([0-9]+)#" => 1,
  45. // http://www.deezer.com/fr/album/379324
  46. "#^\/[a-zA-Z_-]+\/album\/([0-9]+)#" => 1
  47. ),
  48. Element::TYPE_PLAYLIST => array(
  49. // http://www.deezer.com/fr/music/playlist/18701350
  50. "#^\/[a-zA-Z_-]+\/music\/playlist\/([0-9]+)#" => 1
  51. ),
  52. Element::TYPE_TRACK => array(
  53. // http://www.deezer.com/track/4067216
  54. "#^\/track\/([0-9]+)#" => 1
  55. )
  56. );
  57. public static $spotify = array(
  58. Element::TYPE_TRACK => array(
  59. // http://open.spotify.com/track/7ylMdCOkqumPAwIMb6j2D5
  60. "#^\/track\/([a-zA-Z0-9]+)#" => 1
  61. ),
  62. Element::TYPE_ALBUM => array(
  63. // http://open.spotify.com/album/1VAB3Xn92dPKPWzocgQqkh
  64. "#^\/album\/([a-zA-Z0-9]+)#" => 1
  65. ),
  66. Element::TYPE_PLAYLIST => array(
  67. // http://open.spotify.com/user/bux/playlist/2kNeCiQaATbUi3lixhNwco
  68. "#^\/user\/([a-zA-Z0-9_-]+)\/playlist\/([a-zA-Z0-9]+)#" => 2
  69. )
  70. );
  71. }