-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sx networks #69
Sx networks #69
Conversation
sx-network--user-information: User query from site. sx-network--user-sites: List of sites user is active on for use when querying sites. (sx-network--ensure-user): Ensures network-user cache is available for use. (sx-network--update): Retrieve most recent network user information.
sx-favorites--ensure-favorite-list: List of favorites in format (SITE QUESTION_ID QUESTION_ID ...). (sx-favorites--update-site-favorites): Update favorites for given SITE. (sx-favorites-update): Update favorites for all networks user has an account on.
(let ((u-site (cdr (assoc 'site_url loc)))) | ||
(when (member u-site (mapcar 'car sites-info)) | ||
(cdr (assoc u-site sites-info))))) | ||
(sx-network--user-information)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this a variable?
- sx-network--user-information is a var not a function - remember to setq sx-network--user-sites.
sx-favorites--user-favorite-list))) | ||
(if site-cell | ||
(setcdr site-cell (mapcar 'cdar favs)) | ||
(push (list site favs) sx-favorites--user-favorite-list)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be (cons site favs)?
|
||
(defun sx-favorites--retrieve-favorites (site) | ||
"Obtain list of starred QUESTION_IDs for SITE." | ||
(sx-method-call (format "me/favorites?site=%s" site) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
site
is a keyword argument, it should be supplied as such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this is the Kludge I mentioned in gitter. If I pass site as a keyword argument, then meta+main sites will return the same favorite list due to back-to-back retrievals (need to delay ~2 minutes). Passing it this way provides the correct favorite lists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This really doesn't make any sense – have you taken all debugging steps, etc.? If so, we can leave it this way for the PR and open a hi-pri issue to figure out what in heaven's name is going on…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reproducible (users/337/*
is my account, so using it rather than me/*
to provide you the same results.)
(cl-prettyprint
(cl-loop for test-site in '(emacs meta.emacs) collect
(cons test-site
(sx-method-call
"users/337/favorites"
`((site . ,test-site))
sx-favorite-list-filter
'nil))))
((emacs . [((question_id . 3356)) ((question_id . 2497))])
(meta\.emacs . [((question_id . 3356)) ((question_id . 2497))]))
(cl-prettyprint
(cl-loop for test-site in '(emacs meta.emacs) collect
(cons test-site
(sx-method-call
(format "users/337/favorites?site=%s" test-site)
nil
sx-favorite-list-filter
'warn))))
((emacs . [((question_id . 3356)) ((question_id . 2497))])
(meta\.emacs . [((question_id . 218))]))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If all's working. I agree with merging this and opening a separate issue to look into the problem.
Seems like a complicated matter and there's a lot in this PR already.
sx-cache-set. Fix provides lines (missed quote on symbol).
(sx-network--get-associated): Ensure user-sites is also set when retrieving cache. (sx-network--ensure-user): Simplify. Used to ensure cache is loaded before attempting to use it. Fix quoted lambda in sx-network--map-site-url-to-site-api.
sx-favorites--user-favorite-list: Clarify docstring (sx-favorites--ensure-favorite-list): Remove extraneous argument
@@ -0,0 +1,88 @@ | |||
;;; sx-site.el --- browsing sites -*- lexical-binding: t; -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops; also here. :(
Correct file header. Use sharp quote for function.
Use sharp quote for function.
Looks good. |
Functionality for retrieving network information and keeping track of favorite questions.
Provide functionality for retrieving network information as well as keeping track of favorite questions.