cs193p – Project #4 Assignment #4 Extra Task #2

Peter Newell [Public domain], via Wikimedia Commons

Please note, this blog entry is from a previous course. You might want to check out the current one.

When you click on a user in the Users section, search not only for Tweets that mention that user, but also for Tweets which were posted by that user.

If the query is a user name (starts with an @ sign) change the search query to look also for the poster:

    var nextRequestToAttempt: TwitterRequest? {
            if searchText != nil {
                var query = searchText!
                if query.hasPrefix("@") {
                    query = "\(query) OR from:\(query)"
                return TwitterRequest(search: query, count: 100)
            } ...

The complete code for extra task #2 is available on GitHub.


Leave a Reply

Your email address will not be published.