tadnews API

這是寫給 XOOPS 的 tadnews 新聞模組用的API,回傳json格式。

取得所有分類

http://網域/modules/tadnews/app_api.php?op=get_cates

  • op = get_cates

https://www.lces.tn.edu.tw/modules/tadnews/app_api.php?op=get_cates 回傳內容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
[
{
"ncsn": "2",
"title": "教導處",
"of_ncsn": "0",
"sort": "1",
"url": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=2"
},
{
"ncsn": "10",
"title": "教務組",
"of_ncsn": "2",
"sort": "2",
"url": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=10"
},
{
"ncsn": "11",
"title": "學務組",
"of_ncsn": "2",
"sort": "3",
"url": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=11"
},
{
"ncsn": "30",
"title": "會計",
"of_ncsn": "0",
"sort": "4",
"url": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=30"
},
{
"ncsn": "3",
"title": "總務處",
"of_ncsn": "0",
"sort": "5",
"url": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=3"
},
{
"ncsn": "4",
"title": "網管",
"of_ncsn": "0",
"sort": "6",
"url": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=4"
},
{
"ncsn": "12",
"title": "人事",
"of_ncsn": "0",
"sort": "7",
"url": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=12"
},
{
"ncsn": "6",
"title": "校內文件",
"of_ncsn": "0",
"sort": "8",
"url": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=6"
},
{
"ncsn": "1",
"title": "XOOPS",
"of_ncsn": "0",
"sort": "9",
"url": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=1"
},
{
"ncsn": "21",
"title": "健康中心",
"of_ncsn": "0",
"sort": "10",
"url": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=21"
},
{
"ncsn": "32",
"title": "感恩專區",
"of_ncsn": "0",
"sort": "11",
"url": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=32"
}
]
  • ncsn:分類編號
  • title:分類標題
  • of_ncsn:父分類編號
  • sort:分類排序
  • url:分類頁面的網址

取得所有新聞

http://網域/modules/tadnews/app_api.php?op=list_all_news
http://網域/modules/tadnews/app_api.php?op=list_all_news&num=數量
http://網域/modules/tadnews/app_api.php?op=list_all_news&ncsn=分類編號&num=數量

  • op = list_all_news
  • ncsn = 分類編號,顯示某分類新聞
  • num = 整數,顯示數量

https://www.lces.tn.edu.tw/modules/tadnews/app_api.php?op=list_all_news&ncsn=3&num=3 回傳內容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
[
{
"passwd": false,
"nsn": "4373",
"ncsn": "3",
"cate_name": "總務處",
"post_date": "2019-06-28",
"prefix_tag": "公告",
"need_sign": "",
"news_title": "有關法務部調查局108年國安宣導短片,業上傳至Youtube網路頻道,民眾上網觀看。",
"uid": "87",
"uid_name": "徐進文",
"counter": "42",
"content": "",
"g_txt": "全部開放",
"files": null,
"enable": "1",
"have_read_chk": null,
"back_news_link": "",
"back_news_title": "",
"next_news_link": "",
"next_news_title": "",
"image_big": null,
"image_thumb": null,
"not_news": "0"
},
{
"passwd": false,
"nsn": "4367",
"ncsn": "3",
"cate_name": "總務處",
"post_date": "2019-06-17",
"prefix_tag": "公告",
"need_sign": "",
"news_title": "宣導1966長照服務專線1966",
"uid": "87",
"uid_name": "徐進文",
"counter": "32",
"content": "",
"g_txt": "全部開放",
"files": null,
"enable": "1",
"have_read_chk": null,
"back_news_link": "",
"back_news_title": "",
"next_news_link": "",
"next_news_title": "",
"image_big": null,
"image_thumb": null,
"not_news": "0"
},
{
"passwd": false,
"nsn": "4366",
"ncsn": "3",
"cate_name": "總務處",
"post_date": "2019-06-11",
"prefix_tag": "公告",
"need_sign": "",
"news_title": "2019金融服務公益愛心嘉年華活動,請民眾踴躍參加。",
"uid": "87",
"uid_name": "徐進文",
"counter": "34",
"content": "",
"g_txt": "全部開放",
"files": [
{
"url": "https:\/\/www.lces.tn.edu.tw\/uploads\/tadnews\/image\/nsn_4366_1.png",
"file_name": "金融傳愛.png",
"dl_url": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?op=tufdl&files_sn=2930"
}
],
"enable": "1",
"have_read_chk": null,
"back_news_link": "",
"back_news_title": "",
"next_news_link": "",
"next_news_title": "",
"image_big": null,
"image_thumb": null,
"not_news": "0"
}
]
  • nsn:新聞編號
  • ncsn:分類編號
  • cate_name:分類標題
  • post_date:發布日期
  • prefix_tag:標籤
  • need_sign:是否需要簽收
  • news_title:新聞標題
  • uid:發布者編號
  • uid_name:發布者姓名
  • counter:閱讀人次
  • content:文章內容
  • passwd:是否需要密碼
  • g_txt:可閱讀群組
  • files:附檔
    • url:實體檔案連結
    • file_name:原始檔案名稱
    • dl_url:檔案下載連結
  • enable:是否開放
  • have_read_chk:是否已簽收(若應簽收而未簽收傳回false、已簽收會傳回日期、不須簽收傳回null)
  • back_news_link:上一篇新聞連結
  • back_news_title:上一篇新聞標題
  • next_news_link:下一篇新聞連結
  • next_news_title:下一篇新聞標題
  • image_big:封面圖大圖
  • image_thumb:封面圖縮圖
  • not_news:非新聞(即自訂頁面)

顯示某一篇文章

http://網域/modules/tadnews/app_api.php?op=show_news&nsn=文章編號

  • op = show_news
  • nsn = 文章編號

https://www.lces.tn.edu.tw/modules/tadnews/app_api.php?op=show_news&nsn=4367 回傳內容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[
{
"passwd": false,
"nsn": "4367",
"ncsn": "3",
"cate_name": "總務處",
"post_date": "2019-06-17",
"prefix_tag": "公告",
"need_sign": "",
"news_title": "宣導1966長照服務專線1966",
"uid": "87",
"uid_name": "徐進文",
"counter": "32",
"content": "<p>&nbsp;<\/p>\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n<p>宣導1966長照服務專線:跑馬燈文字:<\/p>\r\n\r\n<p><span style=\"font-size:36px;\"><span style=\"color:#FF0000;\">申請長照服務,減輕照顧負擔,請撥打 1966 長照服務 專線(前五分鐘免費),服務時間:週一至週五 上午 8: 30-12:00 下午 1:30-5:30。<\/span><\/span><\/p>\r\n",
"g_txt": "全部開放",
"files": null,
"enable": "1",
"have_read_chk": null,
"back_news_link": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=3&nsn=4366",
"back_news_title": "06-11 2019金融服務公益愛心嘉年華活動,請民...",
"next_news_link": "https:\/\/www.lces.tn.edu.tw\/modules\/tadnews\/index.php?ncsn=11&nsn=4368",
"next_news_title": "06-20 登革熱防治宣導...",
"image_big": null,
"image_thumb": null,
"not_news": "0"
}
]
  • passwd:是否需要密碼
  • nsn:新聞編號
  • ncsn:分類編號
  • cate_name:分類標題
  • post_date:發布日期
  • prefix_tag:標籤
  • need_sign:是否需要簽收
  • news_title:新聞標題
  • uid:發布者編號
  • uid_name:發布者姓名
  • counter:閱讀人次
  • content:文章內容
  • g_txt:可閱讀群組
  • files:附檔
    • url:實體檔案連結
    • file_name:原始檔案名稱
    • dl_url:檔案下載連結
  • enable:是否開放
  • have_read_chk:是否已簽收(若應簽收而未簽收傳回false、已簽收會傳回日期、不須簽收傳回null)
  • back_news_link:上一篇新聞連結
  • back_news_title:上一篇新聞標題
  • next_news_link:下一篇新聞連結
  • next_news_title:下一篇新聞標題
  • image_big:封面圖大圖
  • image_thumb:封面圖縮圖
  • not_news:非新聞(即自訂頁面)
分享到