News for hackers. Stuff that matters.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by dimillian on Friday July 18, 2014 @02:11PM (#8054645)
It still a work in progress, but my plan is to release it on the launch day of iOS 8, with a lot more features. Like a Today widget and a share extension which will allow you to post to HN right from Safari.

Edit: I started an Hacker News Swift scraper, which is what SwiftHN use now, it's called Hacker Swifter: https://github.com/Dimillian/HackerSwifter It's highly inspired from LibHN (https://github.com/bennyguitar/libHN) for the scrapping part at the moment.

Feedbacks and pull requests appreciated :)

Re:Show HN: SwiftHN, a Hacker News reader in Swift by e15ctr0n on Friday July 18, 2014 @03:21PM (#8055067)
Are you seriously scraping or using the official Hacker News API[1]?

[1] https://hn.algolia.io/api

Re:Show HN: SwiftHN, a Hacker News reader in Swift by dimillian on Friday July 18, 2014 @03:25PM (#8055092)
What... wait what.... There is an official API and no one told ... what?

Ok, I'm seriously scraping, and I seriously dislike it, sound like HackerSwifter will now use the API! Thanks!

Edit: But there is no endpoint to have the top items, ask hn etc... right?

Re:Show HN: SwiftHN, a Hacker News reader in Swift by dang on Friday July 18, 2014 @07:28PM (#8056103)
Work is underway on an API to do all of this. Nick and Scott are hacking on it about three feet to my right just now. The days of scraping are numbered.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by dimillian on Saturday July 19, 2014 @04:31AM (#8057010)
This is awesome. So it'll be a new API or an extension of the Algolia API?
Re:Show HN: SwiftHN, a Hacker News reader in Swift by dang on Saturday July 19, 2014 @02:13PM (#8058230)
The former.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by jordanbrown on Friday July 18, 2014 @11:59PM (#8056640)
Great news!
Re:Show HN: SwiftHN, a Hacker News reader in Swift by redox_ on Friday July 18, 2014 @05:06PM (#8055632)
Re:Show HN: SwiftHN, a Hacker News reader in Swift by e15ctr0n on Friday July 18, 2014 @03:32PM (#8055136)
Octopart initially provided the official API[1] and then Algolia took over early this year[2].

[1] https://www.hnsearch.com/api [2] https://news.ycombinator.com/item?id=7130590

A lot of people seem to have used the API to build cool apps.

https://hn.algolia.io/cool_apps

I would read the docs first and jump to conclusions later.

Re:Show HN: SwiftHN, a Hacker News reader in Swift by goblin89 on Saturday July 19, 2014 @03:48AM (#8056956)
YCombinator doesn't endorse Algolia's HN API in any public way, to my knowledge. This makes it just regular third-party API—reliable, convenient, better than scraping, but hardly ‘official’. (Yes, I'm being pedantic.)
Re:Show HN: SwiftHN, a Hacker News reader in Swift by carbocation on Saturday July 19, 2014 @04:02AM (#8056970)
It seems to in the sense that Algolia powers the HN Search at the bottom of every window, and they are co-branded on those search pages. Also, https://hn.algolia.com/api
Re:Show HN: SwiftHN, a Hacker News reader in Swift by goblin89 on Saturday July 19, 2014 @04:36AM (#8057018)
True that, I take back my comment.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by ihuman on Friday July 18, 2014 @04:59PM (#8055594)
How is that official? I thought that was Algolia's API, not YC's
Re:Show HN: SwiftHN, a Hacker News reader in Swift by e15ctr0n on Friday July 18, 2014 @05:12PM (#8055662)
Algolia is a YC company and built the API for YC, which is as official as it gets.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by Alupis on Friday July 18, 2014 @06:08PM (#8055854)
would certainly be a lot less confusing if the api was actually hosted on the same domain.

as-in: news.ycombinator.com/api

or something...

When I search for "news.ycombinator api" I get a bunch of irrelevant or very outdated links...

https://www.google.com/#q=news.ycombinator+api

Re:Show HN: SwiftHN, a Hacker News reader in Swift by serf on Saturday July 19, 2014 @12:07AM (#8056658)
I agree, but it's good marketing. It associates the act of searching with the hostname 'algolia', which seems to be in their interest (being that their tagline is "Hosted cloud search as a service | AlgoliaSearch").
Re:Show HN: SwiftHN, a Hacker News reader in Swift by miket on Friday July 18, 2014 @08:10PM (#8056207)
Looks great, Thomas. If you'd like to use Diffbot [1] to generate clean content summaries of the links for mobile, ala premii, I'd be happy to hook you up with some calls. [1] http://diffbot.com
Re:Show HN: SwiftHN, a Hacker News reader in Swift by danudey on Friday July 18, 2014 @03:09PM (#8054995)
It took me a few moments, but I think you mean 'scraper', and not 'scrapper'?
Re:Show HN: SwiftHN, a Hacker News reader in Swift by dimillian on Friday July 18, 2014 @03:13PM (#8055023)
Totally ^^
Re:Show HN: SwiftHN, a Hacker News reader in Swift by oidar on Friday July 18, 2014 @02:29PM (#8054753)
Looks nice. What is your opinion on Swift now that you've used it for a project?
Re:Show HN: SwiftHN, a Hacker News reader in Swift by dimillian on Friday July 18, 2014 @02:40PM (#8054813)
It's rough, not because of Swift, but because of Xcode. I really love Swift, but it take some time to get up to the speed you are used with Objective-c. Mostly because of the new syntax, but also because Xcode is very buggy around code completion, linking and syntax highlighting.

But for a new app, I would recommend Swift to anyone, it's light, and readable, I really like it.

Re:Show HN: SwiftHN, a Hacker News reader in Swift by eludwig on Friday July 18, 2014 @08:49PM (#8056292)
Debugging Swift is terrible right now in Xcode, unless I am not doing it right. Some values can be seen, others are inexplicably missing. Coming from Java/IntelliJ, it's a hopeless mess.

I hope that Xcode/Swift gets better in the debugging department soon. NSLog() is a rough way to see values. It's just so 1996.

Re:Show HN: SwiftHN, a Hacker News reader in Swift by coldtea on Saturday July 19, 2014 @06:44AM (#8057156)
>I hope that Xcode/Swift gets better in the debugging department soon. NSLog() is a rough way to see values. It's just so 1996.

Well, XCode also has the Swift Playground, with live values updating next to your code etc. Java/IntelliJ don't have that (of course XCode's implementation is beta too, and might not work on some cases).

Re:Show HN: SwiftHN, a Hacker News reader in Swift by emp on Saturday July 19, 2014 @02:15PM (#8058237)
Playground however is just a place for playing with snippets of code. And experiment and learn environment. If you have a bug in a running app, it's just not possible to recreate the problem except for the simplest of apps.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by dimillian on Saturday July 19, 2014 @02:52AM (#8056890)
print and println just works for any value. But yeah, breakpoint and PO at doesn't work for debugging at the moment.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by k-mcgrady on Friday July 18, 2014 @04:48PM (#8055549)
I had some big issues with code completion in Swift in Xcode. The completion engine regularly crashed and all syntax highlighting and warnings/errors disappeared. A total nightmare when you're trying to learn a new language.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by coldtea on Saturday July 19, 2014 @07:09AM (#8057188)
>The completion engine regularly crashed and all syntax highlighting and warnings/errors disappeared. A total nightmare when you're trying to learn a new language.

Kids these days... We had to learn new languages with no "syntax highlighting", no "completion engine", no tutorials, no reference sites and no internet in general. If we were lucky we had some kind of printed manual -- not always.

Re:Show HN: SwiftHN, a Hacker News reader in Swift by k-mcgrady on Saturday July 19, 2014 @10:47AM (#8057592)
I may be a kid (24) but I also remember those days from learning Pascal :)
Re:Show HN: SwiftHN, a Hacker News reader in Swift by tejaswiy on Friday July 18, 2014 @04:10PM (#8055328)
+1 to this. It's like we're back in Xcode 3.x again with Swift.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by nwalter08 on Friday July 18, 2014 @03:00PM (#8054947)
Amen to this. Almost my feelings exactly
Re:Show HN: SwiftHN, a Hacker News reader in Swift by robinhoodexe on Friday July 18, 2014 @02:29PM (#8054750)
Looks extremely nice. Currently I'm using http://hckrnews.com/ both on my laptop as well as on iOS due to the lovely layout for mobile as well as cronologically ordering. If your app can do that as well I'm sold!
Re:Show HN: SwiftHN, a Hacker News reader in Swift by dimillian on Friday July 18, 2014 @02:41PM (#8054826)
Well, I want the app to be as close as what Apple could deliver as I possible. So I plan to keep the feed and comments very clean. It'll also feature some offline feature and automatic background update, very handy.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by robinhoodexe on Friday July 18, 2014 @02:53PM (#8054903)
Sounds very very nice, I can't wait for iOS 8 now. By the way, please add a "add to reading list" for links.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by dimillian on Friday July 18, 2014 @03:01PM (#8054954)
Ahah, to be honest, this was the first feature I put in, you can send any article to the Reading List by swiping a cell. I use the offline feature of the Safari Reading List a lot. This is a killer feature for me. http://cl.ly/Wf4t
Re:Show HN: SwiftHN, a Hacker News reader in Swift by robinhoodexe on Friday July 18, 2014 @03:14PM (#8055031)
Nice. How about filters of some kind? Like "banned words" or the like. Maybe something like http://skimhn.com/.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by jordanbrown on Saturday July 19, 2014 @12:00AM (#8056643)
We should design a dark mode!
Re:Show HN: SwiftHN, a Hacker News reader in Swift by dimillian on Saturday July 19, 2014 @02:53AM (#8056892)
+10 I want to do it! Or pull request :)
Re:Show HN: SwiftHN, a Hacker News reader in Swift by psophis on Friday July 18, 2014 @03:02PM (#8054957)
Have you had to refactor at all between releases of the xcode beta?
Re:Show HN: SwiftHN, a Hacker News reader in Swift by dimillian on Friday July 18, 2014 @03:06PM (#8054981)
Actually, no. The big changes was for the beta 3 and it was mostly around arrays syntax. The old syntax was "deprecated" and Xcode gently allowed me to use the new syntax in 1 click.

I was impressed :) Can't wait to see the changes in new seed next week.

Re:Show HN: SwiftHN, a Hacker News reader in Swift by speg on Friday July 18, 2014 @04:25PM (#8055413)
Re:Show HN: SwiftHN, a Hacker News reader in Swift by dimillian on Friday July 18, 2014 @05:55PM (#8055810)
Ahh yeah, at the tools level, but Swift is actually fine, after sometimes with it :p
Re:Show HN: SwiftHN, a Hacker News reader in Swift by cnp on Friday July 18, 2014 @02:54PM (#8054911)
I am really excited to navigate through this code! Great work.
Re:Show HN: SwiftHN, a Hacker News reader in Swift by revscat on Friday July 18, 2014 @03:37PM (#8055157)
It's good to see some actual code in practice. I'm pleased to see how readable Swift is compared to Objective-C.

Good job.

Re:Show HN: SwiftHN, a Hacker News reader in Swift by tomashertus on Friday July 18, 2014 @04:42PM (#8055515)
Thanks for sharing the code, it looks really nice. I can't wait to dig into it little bit more. Good job