Advertisement
Guest User

Untitled

a guest
May 2nd, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  3. <channel>
  4. <title>Victory Central Church Message Podcast</title>
  5. <link>http://www.vc2online.com</link>
  6. <language>en-us</language>
  7. <copyright>&#x2117; & &#xA9; 2012 Waller Hill Publishing</copyright>
  8. <itunes:subtitle>Victory Central Church Podcast</itunes:subtitle>
  9. <itunes:author>Victory Central Church</itunes:author>
  10. <itunes:summary>The Sermons from Victory Central Church - A regional church sharing the life-giving message of Jesus Christ with Central Georgia and the world!</itunes:summary>
  11. <description>The Sermons from Victory Central Church - A regional church sharing the life-giving message of Jesus Christ with Central Georgia and the world!</description>
  12. <itunes:owner>
  13. <itunes:name>Victory Central Church</itunes:name>
  14. </itunes:owner>
  15. <itunes:image href="images/podcasts_logo.jpg" />
  16. <itunes:category text="Christianity">
  17. <itunes:category text="Spirituality"/>
  18. </itunes:category>
  19.  
  20. <?php
  21.  
  22. $host = 'xxx.xx.xxx.xxx';
  23. $username = 'xxxx';
  24. $password = 'xxxx';
  25. $database = 'xxxx';
  26.  
  27. mysql_connect($host, $username, $password) or die( "Unable to connect.");
  28. @mysql_select_db($database) or die( "Unable to select database.");
  29.  
  30. $result = mysql_query("SELECT * FROM `podcasts` WHERE 1 LIMIT 0 , 30");
  31.  
  32. while ($row = mysql_fetch_array($result))
  33. {
  34. echo "<item>";
  35. echo "<title>" . $row['title'] . "</title>";
  36. echo "<itunes:author>" . $row['author'] . "</itunes:author>";
  37. echo "<itunes:subtitle>" . $row['subtitle'] . "</itunes:subtitle>";
  38. echo "<itunes:summary>" . $row['summary'] . "</itunes:summary>";
  39. echo "<itunes:image href="" . $row['imageurl'] . "" />";
  40. echo "<enclosure url="" . $row['url'] . "" type="" . $row['type'] . "" />";
  41. echo "<guid>" . $row['guid'] . "</guid>";
  42. echo "<pubDate>" . $row['date'] . "</pubDate>";
  43. echo "<itunes:duration>" . $row['duration'] . "</itunes:duration>";
  44. echo "<itunes:keywords>" . $row['keywords'] . "</itunes:keywords>";
  45. echo "</item><br><p />";
  46.  
  47. }
  48.  
  49. ?>
  50.  
  51. </channel>
  52. </rss>
  53.  
  54. use iTunesPodcastFeedChannel;
  55. use iTunesPodcastFeedFeedGenerator;
  56. use iTunesPodcastFeedItem;
  57.  
  58. require __DIR__ . '/vendor/autoload.php';
  59.  
  60. // SETUP CHANNEL
  61. $title = 'Read2Me Daily Curated Articles';
  62. $link = 'https://read2me.online';
  63. $author = 'NYTimes and Medium';
  64. $email = 'hello@read2me.online';
  65. $image = 'https://d22fip447qchhd.cloudfront.net/api/widget/static/images/default-thumbnail.png';
  66. $explicit = false;
  67. $categories = [
  68. 'News',
  69. 'Technology',
  70. 'Culture',
  71. 'Entrepreneurship',
  72. 'Productivity'
  73. ];
  74. $description = 'Daily curated articles from New York Times and Medium';
  75. $lang = 'en';
  76. $copyright = 'The New York Times Company and The Medium Company';
  77. $ttl = 43200; // 12 hours in seconds
  78.  
  79. $channel = new Channel(
  80. $title, $link, $author, $email,
  81. $image, $explicit, $categories,
  82. $description, $lang, $copyright, $ttl
  83. );
  84.  
  85. // SETUP EPISODE
  86. $title = "Trump Says Disclosure of Mueller Questions in Russia Probe Is ‘Disgraceful’";
  87. $fileUrl = 'https://s3.read2me.online/audio/www-nytimes-com-2018-05-01-us-politics-trump-mueller-russia-questions-html-7e9601.mp3';
  88. $duration = '2:18';
  89. $description = 'WASHINGTON — President Trump on Tuesday said it was “disgraceful” that questions the special counsel would like to ask him were publicly disclosed, and he incorrectly noted that there were no questions about collusion. The president also said collusion was a “phony” crime.';
  90. $date = 1525177808;
  91. $filesize = 828387;
  92. $mime = 'audio/mpeg';
  93.  
  94. $item = new Item(
  95. $title, $fileUrl, $duration,
  96. $description, $date, $filesize, $mime
  97. );
  98. $item2 = clone $item; // just to give you an idea of how it works
  99.  
  100. // SETUP FEED
  101. $feed = new FeedGenerator($channel, ...[$item, $item2]);
  102.  
  103. // OUTPUT XML
  104. print $feed->getXml();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement