RSS / Atom feed を読み込みます。
using UnityEngine;
using UdonSharp;
using nekomimiStudio.FeedReader;
public class example : UdonSharpBehaviour
{
[SerializeField] private FeedReaderCore feeds;
private bool done = false;
public override void Interact()
{
done = false;
feeds.Load();
}
void Update()
{
if (!done && feeds != null)
{
if (feeds.isReady())
{
Debug.Log($"entries: {feeds.getTotalEntryCount()}");
for (int i = 0; i < feeds.getFeedLength(); i++)
{
if (feeds.errors()[i] != null)
{
var error = (VRC.SDK3.StringLoading.IVRCStringDownload)feeds.errors()[i];
Debug.Log($"{error.Url.ToString()}: {error.ErrorCode.ToString()}: {error.Error}");
if (error.Error.StartsWith("Not trusted url hit"))
Debug.Log("Check Settings -> Comfort & safety -> Safety -> Allow Untrusted URLs");
}
else
{
Debug.Log(feeds.getFeedHeaderItem(i, FeedHeader.Title));
for (int j = 0; j < feeds.getFeedEntryLength(i); j++)
{
Debug.Log(feeds.getFeedEntryItem(i, j, FeedEntry.Title));
Debug.Log(feeds.getFeedEntryItem(i, j, FeedEntry.Summary));
}
}
}
done = true;
}
else if (feeds.isLoading())
{
Debug.Log($"loading... {feeds.GetProgress()}");
}
/*
FeedHeader and FeedEntry are written in ./Runtime/Script/feedReader.cs (scroll to end of the file)
*/
}
}
}
studio.nekomimi.feedreader
Undefined
0.2.6
Undefined
No dependencies
No legacy packages
BSD 1-Clause