puse / machina

Proof-of-concept browser automation toolkit :construction:
Mozilla Public License 2.0
1 stars 0 forks source link

Introduce high-level `TwitterBrowser` abstraction to open views #35

Closed antaranyan closed 2 years ago

antaranyan commented 2 years ago

For example, capabilities of UserProfileView, such as readBio, make sense only for a successfully loaded profile view. Before it's loaded or if it can't be loaded, these would be different interfaces.

For this case, it seems like UserProfileView is a result of an operation that might fail, so having open as an instance method is not convenient. I imagine a better way will be having a top-level structure like TwitterBrowser instance, which will call openUserProfile yielding a UserProfileView in event of success, and UserNotFoundView when it fails.

Related

antaranyan commented 2 years ago

Waiting for #34 for this change to be easier.