# -*- coding: utf-8 -*-

ENABLE = 1
NEWS_ID = 25

NEWS_TITLE = "高應盃籃球錦標賽"
NEWS_IMAGE = "http://i.imgur.com/NAxVxbV.jpg"
NEWS_URL = "http://goo.gl/Yh1iIF"
NEWS_CONTENT = """
"""

def news_status():
    return [ENABLE, NEWS_ID]

def news():
    """
    News for kuas.

    return [enable, news_id, news_title, news_template, news_url]
        enable: bool
        news_id: int
        news_title: string
        news_tempalte: string
        news_url: string
    """
   
    news_title = NEWS_TITLE
    news_template = (
            "<div style='text-align:center;'>"
            "<div><img style='display:block;margin-left:auto;margin-right:auto;max-width:80%;min-height:150px;height:auto;' src='"
            + NEWS_IMAGE + "'></img>" + NEWS_CONTENT + "</div>" +
            "</div>"

        )
    news_url = NEWS_URL

    return [ENABLE, NEWS_ID, news_title, news_template, news_url]

@@ -18,16 +18,31 @@
 -8 -*-%0A%0A
+import random%0A%0A
 ENABLE =
@@ -55,17 +55,17 @@
 S_ID = 2
-5
+6
 %0A%0ANEWS_T
@@ -76,16 +76,8 @@
  = %22
-%E9%AB%98%E6%87%89%E7%9B%83%E7%B1%83%E7%90%83%E9%8C%A6%E6%A8%99%E8%B3%BD
 %22%0ANE
@@ -178,16 +178,596 @@
 %22%22%0A%22%22%22%0A%0A
+def random_news():%0A    news_list = %5B%0A        %7B%0A            %22news_title%22: %22%E9%AB%98%E6%87%89%E7%9B%83%E7%B1%83%E7%90%83%E9%8C%A6%E6%A8%99%E8%B3%BD%22,%0A            %22news_image%22: %22http://i.imgur.com/NAxVxbV.jpg%22,%0A            %22news_url%22: %22http://goo.gl/Yh1iIF%22,%0A            %22news_content%22: %22%22%0A        %7D, %0A%0A        %7B%0A            %22news_title%22: %22%E6%87%89%E5%A4%96 News %E8%B5%B7%E4%BE%86%22,%0A            %22news_image%22: %22http://i.imgur.com/sVMvNhr.jpg%22,%0A            %22news_url%22: %22https://www.facebook.com/AFLDEARS%22,%0A            %22news_content%22: %22%22%22%0A            %E6%87%89%E5%A4%96Nova News %E8%AE%93%E4%BD%A0%E6%98%A5%E9%A2%A8%E6%BB%BF%E9%9D%A2 %E5%89%8D%E7%84%A1%E5%8F%A4%E4%BA%BA %E5%85%A8%E6%96%B0%E6%B4%BB%E5%8B%95%3Cbr%3E%0A            3/30 %E9%9A%86%E9%87%8D%E7%99%BB%E5%A0%B4%EF%BC%81%0A            %22%22%22%0A        %7D%0A    %5D%0A%0A%0A    return random.choice(news_list)%0A%0A%0A
 def news
@@ -807,16 +807,17 @@
 WS_ID%5D%0A%0A
+%0A
 def news
@@ -1058,31 +1058,97 @@
     
-news_title = NEWS_TITLE
+# Get news from random news%0A    news = random_news()%0A%0A    news_title = news%5B%22news_title%22%5D
 %0A   
@@ -1362,46 +1362,62 @@
   + 
-NEWS_IMAGE + %22'%3E%3C/img%3E%22 + NEWS_CONTENT
+news%5B%22news_image%22%5D + %22'%3E%3C/img%3E%22 + news%5B%22news_content%22%5D
  + %22
@@ -1473,24 +1473,32 @@
 s_url = 
-NEWS_URL
+news%5B%22news_url%22%5D
 %0A%0A    re

Add AFLD events