Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <location>
- <name>Name</name>
- <weeks>
- <week>
- <Sunday>
- <times>
- <currently_open>false</currently_open>
- <status>open</status>
- <hours>
- <hour>
- <from>10am</from>
- <to>6pm</to>
- </hour>
- </hours>
- </times>
- <date>2018-09-23</date>
- <rendered>10am - 6pm</rendered>
- </Sunday>
- <Monday>
- <times>
- <currently_open>false</currently_open>
- <status>open</status>
- <hours>
- <hour>
- <from>8:30am</from>
- <to>12am</to>
- </hour>
- </hours>
- </times>
- <date>2018-09-24</date>
- <rendered>8:30am - 12am</rendered>
- </Monday>
- <Tuesday>
- <times>
- <currently_open>false</currently_open>
- <status>open</status>
- <hours>
- <hour>
- <from>8:30am</from>
- <to>12am</to>
- </hour>
- </hours>
- </times>
- <date>2018-09-25</date>
- <rendered>8:30am - 12am</rendered>
- </Tuesday>
- <Wednesday>
- <times>
- <currently_open>true</currently_open>
- <status>open</status>
- <hours>
- <hour>
- <from>8:30am</from>
- <to>12am</to>
- </hour>
- </hours>
- </times>
- <date>2018-09-26</date>
- <rendered>8:30am - 12am</rendered>
- </Wednesday>
- <Thursday>
- <times>
- <currently_open>false</currently_open>
- <status>open</status>
- <hours>
- <hour>
- <from>8:30am</from>
- <to>12am</to>
- </hour>
- </hours>
- </times>
- <date>2018-09-27</date>
- <rendered>8:30am - 12am</rendered>
- </Thursday>
- <Friday>
- <times>
- <currently_open>false</currently_open>
- <status>open</status>
- <hours>
- <hour>
- <from>8:30am</from>
- <to>12am</to>
- </hour>
- </hours>
- </times>
- <date>2018-09-28</date>
- <rendered>8:30am - 12am</rendered>
- </Friday>
- <Saturday>
- <times>
- <currently_open>false</currently_open>
- <status>open</status>
- <hours>
- <hour>
- <from>10am</from>
- <to>6pm</to>
- </hour>
- </hours>
- </times>
- <date>2018-09-29</date>
- <rendered>10am - 6pm</rendered>
- </Saturday>
- </week>
- </weeks>
- </location>
- String URLString = "https://api3.libcal.com/api_hours_grid.php?iid=4246&format=xml&weeks=1&systemTime=0";
- XDocument xdoc = new XDocument();
- xdoc = XDocument.Load(URLString);
- var location = (from p in xdoc.Descendants("location")
- from s in p.Descendants("week").Elements()
- //from l in p.Descendants().Where( l => l.Ends)
- select new
- {
- CampusName = (string)p.Element("name"),
- WeekD = (string)s.Element("date"),
- OpenHours = (string)s.Element("rendered"),
- //D = p.Descendants("week").Where(z => p.Element.EndsWith("day"))
- }).ToList();
Add Comment
Please, Sign In to add comment