h9k / magirc

PHP Frontend for Anope / Denora IRC Statistics
https://h9k.github.io/magirc/
34 stars 14 forks source link

API returns lots of empty fields but MagIRC interface does not? #129

Closed ghost closed 8 years ago

ghost commented 8 years ago

API returns lots of empty fields like modes, topic etc.

{"aaData":[{"channel":"#Chatroom","users":"126","users_max":"794","users_max_time":"2016-05-01 01:59:04","topic":"","topic_html":null,"topic_author":null,"topic_time":null,"kicks":null,"modes":null,"modes_data":null,"DT_RowId":"#Chatroom"},{"channel":"#ICQ","users":"10","users_max":"30","users_max_time":"2016-05-08 13:36:37","topic":"","topic_html":null,"topic_author":null,"topic_time":null,"kicks":null,"modes":null,"modes_data":null,"DT_RowId":"#ICQ"},{"channel":"#","users":"7","users_max":"25","users_max_time":"2016-05-08 13:16:56","topic":"","topic_html":null,"topic_author":null,"topic_time":null,"kicks":null,"modes":null,"modes_data":null,"DT_RowId":"#"},{"channel":"#Family","users":"5","users_max":"16","users_max_time":"2016-04-27 18:34:08","topic":"","topic_html":null,"topic_author":null,"topic_time":null,"kicks":null,"modes":null,"modes_data":null,"DT_RowId":"#Family"},{"channel":"#Romance","users":"5","users_max":"79","users_max_time":"2016-04-21 03:31:24","topic":"","topic_html":null,"topic_author":null,"topic_time":null,"kicks":null,"modes":null,"modes_data":null,"DT_RowId":"#Romance"},{"channel":"#Bi_Men","users":"4","users_max":"12","users_max_time":"2016-04-18 00:40:58","topic":"","topic_html":null,"topic_author":null,"topic_time":null,"kicks":null,"modes":null,"modes_data":null,"DT_RowId":"#Bi_Men"},{"channel":"#hot-tub","users":"3","users_max":"8","users_max_time":"2016-05-08 02:34:15","topic":"","topic_html":null,"topic_author":null,"topic_time":null,"kicks":null,"modes":null,"modes_data":null,"DT_RowId":"#hot-tub"},{"channel":"#Lesbian","users":"2","users_max":"8","users_max_time":"2016-05-07 15:09:42","topic":"","topic_html":null,"topic_author":null,"topic_time":null,"kicks":null,"modes":null,"modes_data":null,"DT_RowId":"#Lesbian"},{"channel":"#40_something","users":"1","users_max":"5","users_max_time":"2016-05-06 19:58:33","topic":"","topic_html":null,"topic_author":null,"topic_time":null,"kicks":null,"modes":null,"modes_data":null,"DT_RowId":"#40_something"},{"channel":"#ChatWorld","users":"1","users_max":"18","users_max_time":"2016-04-05 10:58:00","topic":"","topic_html":null,"topic_author":null,"topic_time":null,"kicks":null,"modes":null,"modes_data":null,"DT_RowId":"#ChatWorld"}]}

but MagIRC interface does not have empty fields, it shows modes, topic etc.

@h9k how to fix?

h9k commented 8 years ago

MagIRC uses the very same API, so it sounds unusual. Can you provide an example URL?

ghost commented 8 years ago

@h9k yeah.

http://www.allchatnetwork.net/stats/rest/service.php/channels/biggest/10?format=datatables shows empty data but the data is present in for example http://www.allchatnetwork.net/stats/channel/%23Chatroom/profile.

h9k commented 8 years ago

For some reason stuff like topics and modes were left out for the biggest chan output. However you can use http://www.allchatnetwork.net/stats/rest/service.php/channels for example

ghost commented 8 years ago

@h9k How do I get top 10 channels using that?

h9k commented 8 years ago

@ghost you could get the whole channel list, then sort by users descending, and take the first 10. However, I will make it so that the "biggest" call will return the data in the same manner as normal channels. Will commit to repo this weekend.