Git Product home page Git Product logo

hackers's Introduction

Hi there 👋

GitHub Stats

hackers's People

Contributors

99arobe avatar alextrob avatar anosidium avatar fdawgs avatar jalxp avatar jeffreyca avatar mzain512 avatar noloman avatar rileydnorris avatar sr42 avatar vhschlenker avatar weiran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hackers's Issues

Feature discoverability

All the new features added are hard to discover as they are all gesture based. Some sort of feature discoverability should be added. For simplicity I think I'll go for the boring but easy to implement onboarding interstitial�.

Add option to disable thumbnails

What do you think about adding an option to disable thumbnails? I find them to be distracting, because they are usually too blurry, irrelevant, and load very slowly. Even the "Y" icon used for Ask HN looks terrible and pixelated.

I don't have any suggestions for what an alternative UI would look like. I would be fine with the default Safari icon for everything though.

Thanks!

Oops

Hi again @weiran,

Apologies for #45 getting out of hand. Sadly, I have some more "bad" news in the same vein. I kept working in private, ashamed of how out of control my PR was getting as normally I create one off PRs. I guess I just got super duper into building the best fucking Hacker News app for iOS that I possibly could so I went all out. It may have also had something to do with recently leaving my last job after extreme burnout and being in a continual state of shock.

Anyway, I reached out to you via Twitter DM a few months ago about this but never heard anything so I wanted to open this issue so that I could be sure you saw it.

I know that merging all of this at once would probably be pretty insane, so I'm hoping you and others can cherry pick my best pieces. Just about everything except some specific minor UI stuff works (minor UI stuff being like the constraints sometimes screw up on stories that I can't extract media for).

I would offer to break all this up myself into individual PRs but I'm up to my neck in @home-assistant mobile work for the rest of the year at this point and all this stuff is so good that it didn't feel right to keep it to myself especially since I saw #68, #71 and #93 were on your near term todo list.

I've been using my fork multiple times per day since I finished working on it back in October. It's amazing. Totally replaces the browser for me.

I shot a quick little video for you to get a sense of where things are. I'd invite you to check out the branch and build it yourself.

Thanks, and again, please accept my apologies that I locked up all this fantastic (IMHO!) work in a single branch. It's one of my largest regrets of the last 2 or 3 years of my programming career.

Let me know if you or anyone else has questions. I'm excited to see Hackers become the end all be all best Hacker News app on iOS very soon 😄.


Here's what is in this new fork I've got going:

  • A clean room replacement for the existing Hacker News libraries on iOS. I call it UltraHN. It takes a bit of each official API (Algolia & Firebase) and combines it with HTML scraping. I dug through every single resource about all of the sources that I could find and visually inspected and documented differences between all three in painstaking detail.
  • UltraHN supports almost every action that can be taken by an authenticated user:
    • Voting (up/down and unvoting)
    • Flagging
    • Submitting stories
    • Submitting comments
    • Seeing secret, YC only, profile fields
    • Collapsing comments in the app syncs to the website and vice versa
    • Favoriting
    • One of the biggest things it doesn't support is editing existing comments and submissions.
  • UltraHN extracts bits of HTML that are significant to the UX, such as the grey levels of downvoted comments and correct colors for usernames
  • Implements search via Algolia
  • Has realtime update support thanks to Firebase. Realtime updates happen for comments and stories.

Thanks to UltraHN, I've been able to significantly improve the available views. Hackers now has support for:

  • Viewing your profile as well as others profiles just by tapping their username. Even lets you see that users submissions, comments and favorites. For your own profile you can also view hidden and upvoted submissions.
  • Here's all the views we now support:
    • Home page (/news)
    • Classic algorithm home page (/classic)
    • Latest submissions (/newest)
    • Jobs (/jobs)
    • Ask HN (/ask)
    • Show HN (/show)
    • Show HN by newest (/shownew)
    • All news with most active discussion thread first (/active)
    • Highest (recent) score (/best)
    • Most recent stories submitted by new users (/noobstories)
    • Submissions with more than the given point value (/over)
    • Homepage for a specific date (/front)
    • Posts submitted by the given username (/submitted)
    • Comments submitted by the given username (/comments)
    • Posts favorited by the given username (/favorites)
    • Posts upvoted by the given username (/upvoted)
    • Posts hidden by the given username (/hidden)
    • Posts from the provided domainName (/from)
    • Users profile
    • Leaderboard
    • Search

There's a lot more things that building UltraHN allowed me to do, but also a lot of other improvements to the UI and UX:

  • A new, more visual, table view cell for the feeds
  • Keyboard shortcuts
  • Better notification filtering
  • Improved iPad experience
  • Allow the tab bar to be customized
  • A new image extractor backend which prioritizes better looking open graph images as well as adds caching.

There's generally a whole lot of other minor improvements here and there and it's been 5 months since I last touched the code and git log only tells me so much.

All of this is of course in addition to my UI Improvements PR (#45). As a reminder, that featured:

  • Two new themes, a pure black theme for OLED devices and a "original" theme which matches news.ycombinator.com in terms of colors and fonts (Verdana).
  • Handoff support for comments and links
  • Allow users to choose a browser to open a link in (SFSafariViewController, SFSafariViewController in reader mode, Safari or Chrome)
  • Long press on a link in NewsViewController to share link
  • When sharing, we give the user the option of either sharing the content link or the comments link
  • Long press on a comment now allows sharing a link to that comment
  • SFSafariViewController is initialized with barCollapsingEnabled = TRUE (Indicates if SFSafariViewController should enable collapsing of the navigation bar and hiding of the bottom toolbar when the user scrolls web content.)
  • Hides tab bar on comments view
  • Tapping a jobs post goes directly to the link instead of comments since job posts don't have comments.
  • Extends comments view to superview so comments are behind home indicator
  • Redid the settings page with Eureka so that it's easier to handle the inline theme picker as well as provide a good foundation for other future settings.
  • Removed the custom share icon and instead used the system default icon.
  • Minor other tweaks

Handle reCAPTCHA on login

If you test a lot of login requests, Hacker News can start to show a reCAPTCHA to prove you're not a bot. In this case we should instead ask the user to login via the web page and capture the authentication cooke afterwards.

Asking Hacker News to add a apple-app-association-file

Hey @weiran, I pinged you on Twitter but realized it would probably be good to also make an issue about this...

I'm working on some major improvements to Hackers, one of them being authentication so that you can up and down vote stories and comments. It's working great already, but for that extra sparkle effect I want to get Password Autofill up and running. However, to do that we need to have the Hacker News team add a apple-app-association-file to their domain. I think that they would happy to do it, especially since the file can allow any number of other apps to also get the same experience just by adding the bundle ID. And i'll add that even if Hackers died sometime in the future (not that I expect it to!) it wouldn't hurt any users of the app or otherwise in any way. It's much like a robots.txt file, some apps will check for it and everyone else doesn't even know it exists really.

I thought i'd check with you before reaching out to the team on the off chance you wanted to handle it. If not, I would happily do it and it would perhaps even get a better response because I am myself a YC founder...

Anyway, let me know, will leave this open until I hear back.

BTW, the file looks like this and placed at https://news.ycombinator.com/apple-app-site-association (or https://news.ycombinator.com/.well-known/apple-app-site-association):

{
  "webcredentials": {
    "apps": [
      "2KB59GPA9B.com.weiranzhang.Hackers"
    ]
  }
}

Notifications?

@weiran Any thoughts on implementing push notifications? I think it's one of the key things missing in any Hacker News app. The simple v1 can just be notifications when a story is >= X points. I'm willing to write the backend for this, probably just something with Firebase Cloud Messaging so that we can use topics to determine what devices to send notifications to.

As another option that wouldn't require a backend service, we can build something similar to what GitHawk does, where it uses background fetch to trigger notifications by fetching data from GitHub. The nice side effect of this would be we can cache data in the background so that the app always has fresh data. More info about GitHawk's implementation is available here.

Crash when opening a link in comment with an unsupported URL

Incident Identifier: FED39AB7-D6E1-4CC5-84B8-774189E5C028
CrashReporter Key:   18577e6b9b5509c445159c021d1486229f7833a8
Hardware Model:      iPad6,11
Process:             Hackers [639]
Path:                /private/var/containers/Bundle/Application/AC4775D0-B097-48F9-AB7E-436632C34E34/Hackers.app/Hackers
Identifier:          com.weiranzhang.Hackers
Version:             52 (3.6.2)
AppStoreTools:       10E121a
AppVariant:          1:iPad6,11:12
Code Type:           ARM-64 (Native)
Role:                Non UI
Parent Process:      launchd [1]
Coalition:           com.weiranzhang.Hackers [549]


Date/Time:           2019-06-03 20:42:53.8623 +0400
Launch Time:         2019-06-03 20:42:34.5382 +0400
OS Version:          iPhone OS 12.1.4 (16D57)
Baseband Version:    n/a
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                	0x20d63dea4 __exceptionPreprocess + 228 (NSException.m:172)
1   libobjc.A.dylib               	0x20c80da50 objc_exception_throw + 56 (objc-exception.mm:557)
2   CoreFoundation                	0x20d544484 +[NSException raise:format:] + 116 (NSException.m:145)
3   SafariServices                	0x222db95cc -[SFSafariViewController initWithURL:configuration:] + 112 (SFSafariViewController.m:49)
4   Hackers                       	0x103003404 @objc ThemedSafariViewController.init(url:configuration:) + 180 (ThemedSafariViewController.swift:0)
5   SafariServices                	0x222db9bb8 -[SFSafariViewController initWithURL:] + 100 (SFSafariViewController.m:218)
6   Hackers                       	0x103010494 specialized CommentsViewController.linkTapped(_:sender:) + 204 (<compiler-generated>:0)
7   Hackers                       	0x10300f020 protocol witness for CommentDelegate.linkTapped(_:sender:) in conformance CommentsViewController + 20 (<compiler-generated>:0)
8   Hackers                       	0x102ffabcc specialized CommentTableViewCell.textView(_:shouldInteractWith:in:) + 140 (CommentTableViewCell.swift:77)
9   Hackers                       	0x102ffa190 @objc CommentTableViewCell.textView(_:shouldInteractWith:in:) + 124 (<compiler-generated>:0)
10  UIKitCore                     	0x23a894f90 -[_UITextViewInteractableLink allowInteraction:] + 360 (UITextView_LinkInteraction.m:782)
11  UIKitCore                     	0x23a893cc8 -[_UITextViewInteractableItem handleTap] + 40 (UITextView_LinkInteraction.m:547)
12  UIKitCore                     	0x23a7f1430 -[UITextLinkInteraction tapOnLinkWithGesture:] + 452 (UITextLinkInteraction.m:139)
13  UIKitCore                     	0x23a7eed84 -[UITextInteraction tapOnLinkWithGesture:] + 200 (UITextInteraction.m:353)
14  UIKitCore                     	0x23a7f2688 -[UITextNonEditableInteraction oneFingerTapInUneditable:] + 96 (UITextNonEditableInteraction.m:33)
15  UIKitCore                     	0x23a16d0d0 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 64 (UIGestureRecognizer.m:113)
16  UIKitCore                     	0x23a1756ec _UIGestureRecognizerSendTargetActions + 124 (UIGestureRecognizer.m:1148)
17  UIKitCore                     	0x23a172f70 _UIGestureRecognizerSendActions + 320 (UIGestureRecognizer.m:1187)
18  UIKitCore                     	0x23a172458 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 764 (UIGestureRecognizer.m:0)
19  UIKitCore                     	0x23a165760 _UIGestureEnvironmentUpdate + 1096 (UIGestureEnvironment.m:159)
20  CoreFoundation                	0x20d5cd6bc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1822)
21  CoreFoundation                	0x20d5c8350 __CFRunLoopDoObservers + 412 (CFRunLoop.c:1932)
22  CoreFoundation                	0x20d5c88f0 __CFRunLoopRun + 1264 (CFRunLoop.c:2950)
23  CoreFoundation                	0x20d5c80e0 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
24  GraphicsServices              	0x20f841584 GSEventRunModal + 100 (GSEvent.c:2245)
25  UIKitCore                     	0x23a554c00 UIApplicationMain + 212 (UIApplication.m:4347)
26  Hackers                       	0x102ffa460 main + 68 (CommentTableViewCell.swift:10)
27  libdyld.dylib                 	0x20d086bb4 start + 4

Refactor CommentModel type

Currently CommentModel is a fairly useless copy of HNComment with a couple of computer values. This could just be an extension or implemented some other way.

Swipe gesture too sensitive

Had various reports since 4.0 that scrolling is now a lot harder because the swipe gesture is too sensitive.

Future plans for Hackers

Apple announced a lot of interesting things at WWDC 2019, including SwiftUI and Combine. Since the keynote I've been thinking about how Hackers could adapt to use those new frameworks, and I think the best way is to do (another) ground up rewrite, like when Swift was introduced. The current codebase has already gone through almost every Swift version migration, and is suffering from some bad choices made back in Swift 1 days. I would also love to integrate some of the features from #100 in this, as well as extracting UltraHN into it's own modern and well maintained Hacker News library for iOS.

This is obviously a big change that will bring little in the way of user benefits initially, but should lay the groundwork for the next few years of iteration on Hackers. But first I want to get one last release on the current codebase out (4.0) that will include everything currently planned.

it seems missing "GCOLaunchImageTransition" pod dependency in podfile

Error:
GCOLaunchImageTransition/GCOLaunchImageTransition.h not found

steps:
1.git clone --recursive https://github.com/weiran/Hackers.git

2.cd Hackers && pod install

3.console print

Fetching podspec for `NNNetwork` from `NNNetwork-temp.podspec`
Downloading dependencies
Installing AFNetworking (1.3.4)
Installing ARChromeActivity (1.0.4)
Installing ARKippsterActivity (1.0.1)
Installing DTCoreText (1.6.14)
Installing DTFoundation (1.7.4)
Installing FontAwesomeIconFactory (1.4)
...

4.Xcode 6.1 open

5.error occured

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.