Development of background project 1
This commit is contained in:
@@ -89,26 +89,41 @@ namespace FoxTube.Background
|
||||
ApiKey = "AIzaSyBgHrCnrlzlVmk0cJKL8RqP9Y8x6XSuk_0",
|
||||
ApplicationName = "FoxTube"
|
||||
}).Activities.List("snippet");
|
||||
request.PublishedAfter = lastCheck;
|
||||
request.ChannelId = s;
|
||||
request.MaxResults = 10;
|
||||
var response = await request.ExecuteAsync();
|
||||
|
||||
if(response.Items.Count > 0)
|
||||
foreach (Activity a in response.Items)
|
||||
{
|
||||
if(a.Snippet.Type == "upload")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CheckAnnouncements()
|
||||
string CheckAnnouncements()
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(XmlReader.Create("http://foxgame.hol.es/ftp.xml"));
|
||||
if ((XmlConvert.ToDateTime((doc["posts"].FirstChild as XmlElement).GetAttribute("time"), XmlDateTimeSerializationMode.Utc) - lastCheck).TotalSeconds > 0)
|
||||
Notifications.Add(new Notification(NotificationType.Internal,
|
||||
if ((XmlConvert.ToDateTime((doc["posts"].FirstChild as XmlElement).GetAttribute("time"), XmlDateTimeSerializationMode.Utc) - lastCheck.ToUniversalTime()).TotalSeconds > 0)
|
||||
Add(new Notification(NotificationType.Internal,
|
||||
doc["posts"].FirstChild["notificationHeader"].InnerText,
|
||||
doc["posts"].FirstChild["content"].InnerText,
|
||||
XmlConvert.ToDateTime((doc["posts"].FirstChild as XmlElement).GetAttribute("time"),
|
||||
XmlDateTimeSerializationMode.Local), (doc["posts"].FirstChild as XmlElement).GetAttribute("image")));
|
||||
if ((bool)settings.Values["newmessagesNotification"] == true)
|
||||
SendNotification(Notifications.Last());
|
||||
|
||||
return doc.InnerXml;
|
||||
}
|
||||
|
||||
void SendNotification(Notification notification)
|
||||
{
|
||||
ToastNotificationManager.CreateToastNotifier().Show(notification.GetToast(0));
|
||||
}
|
||||
|
||||
void Add(Notification notification)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user