pittcsc / PittAPI

An API to easily get data from the University of Pittsburgh
https://pittapi.pittcsc.org
GNU General Public License v2.0
105 stars 30 forks source link

Create a News API #46

Closed RitwikGupta closed 7 years ago

RitwikGupta commented 7 years ago

I found this URL: https://m.pitt.edu/news/index.json?feed=main_news&id=&_object=kgoui_Rcontent_I0_Rcontent_I0&_object_include_html=1

Gets us all the Pitt news. There are different feeds that go into the feed URL path paramater:

feeds = (
    "main_news",  # pitt.com main news
    "cssd",  # student announcements, stuff that goes on My Pitt
    "news_chronicle",  # the Pitt Chronicle news
    "news_alerts"  # crime alerts
)
Rahi374 commented 7 years ago

The JSON response looks like it's in the same format as the data that I retrieved for the DiningAPI.

RitwikGupta commented 7 years ago

It is. They use Kurogi to provide these services so the responses are similar.

Rahi374 commented 7 years ago

Ah I see. I started working on this one.

Rahi374 commented 7 years ago

Oh wait but the only data we get from the JSON is the name of the news event/article and a link to it. It it enough to just return an array of dicts of article-name and url pairs?

RitwikGupta commented 7 years ago

Yes, that's perfect! Please also write tests as you go along.

Rahi374 commented 7 years ago

Tests... okay...

RitwikGupta commented 7 years ago

Just follow the format of one of the tests in tests/! The Dining tests might be the best for you.

Rahi374 commented 7 years ago

Hmm. I'll try.

RitwikGupta commented 7 years ago

Closed! 🎉