Re:Hacker News API
by kevin on Tuesday October 07, 2014 @02:49PM
(#8423131)
Use the Firebase libraries rather than the REST one to efficiently handle requests. I believe it uses a websocket internally. "It does all the work for you and is awesome." to quote Nick.
[ Parent
| on HN ]
Well unfortunately there's no Firebase SDK for Windows Phone/C#/WinRT, and the WebSocket API is undocumented.
EDIT: After having played with the JS SDK a bit I'd like to add that it is indeed incredibly awesome.
[Firebase founder] There is a Firebase C# SDK on the way. We've had some other things, that we've been working on for the last year, that are shipping in the next few weeks which have taken priority. After that, we'll be shifting focus to new SDKs (they're a little complicated and take a bit of time to build)
Re:Hacker News API
by meursault334 on Tuesday October 07, 2014 @10:35PM
(#8425053)
I'm really glad to hear this. I have been loving Firebase for the app I'm making but one of the components has to run in C# and talking to Firebase from the C# app was much more painful than the other Firebase portions of the application.
This would be awesome. Right now I'm experimenting using raw HTTP requests and Newtonsoft.Json as the JSON [de]serializer. I presume that you will make your C# SDK a portable class library so we can use it in iOS and Android apps as well via Xamarin?
"C# SDK" doesn't say much. SilverLight can use C#, WinRT can use C#, .NET can use C#, but that doesn't mean your "C# library" will run everywhere. C# is just the syntax.
Also, while they don't have a Windows Phone API I previously wrote a COM Windows Scripting API to use it via Chackra from an ASP.Net app.
I think it's even easier now that JS is a supported app language.
Are you referring to the WebSocket API that the Firebase SDKs use internally? It doesn't seem to be documented anywhere so I guess it's only slightly better than scraping HTML ;)
I set things up so I could actually run their whole JS SDK and talk to it from C#.
Thanks for the tip, I actually just figured that out myself a few minutes ago. Should be good enough until a proper SDK arrives.
With access to a Firebase SDK the only major additions the API needs to become a viable replacement for existing read-only client apps would be support for all the other lists apart from top stories (new, show, show new, ask, jobs, best, active) and more than 100 items for each. For apps that need write access I'd suggest keeping the current website on a separate subdomain until that is implemented into the API.