{"action":"created","issue":{"url":"https://api.github.com/repos/IvanMalison/okcupyd/issues/63","labels_url":"https://api.github.com/repos/IvanMalison/okcupyd/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/IvanMalison/okcupyd/issues/63/comments","events_url":"https://api.github.com/repos/IvanMalison/okcupyd/issues/63/events","html_url":"https://github.com/IvanMalison/okcupyd/issues/63","id":95433566,"number":63,"title":"Support new okcupid.com json API","user":{"login":"dubiousjim","id":232158,"avatar_url":"https://avatars.githubusercontent.com/u/232158?v=3","gravatar_id":"","url":"https://api.github.com/users/dubiousjim","html_url":"https://github.com/dubiousjim","followers_url":"https://api.github.com/users/dubiousjim/followers","following_url":"https://api.github.com/users/dubiousjim/following{/other_user}","gists_url":"https://api.github.com/users/dubiousjim/gists{/gist_id}","starred_url":"https://api.github.com/users/dubiousjim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dubiousjim/subscriptions","organizations_url":"https://api.github.com/users/dubiousjim/orgs","repos_url":"https://api.github.com/users/dubiousjim/repos","events_url":"https://api.github.com/users/dubiousjim/events{/privacy}","received_events_url":"https://api.github.com/users/dubiousjim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"IvanMalison","id":1246619,"avatar_url":"https://avatars.githubusercontent.com/u/1246619?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanMalison","html_url":"https://github.com/IvanMalison","followers_url":"https://api.github.com/users/IvanMalison/followers","following_url":"https://api.github.com/users/IvanMalison/following{/other_user}","gists_url":"https://api.github.com/users/IvanMalison/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanMalison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanMalison/subscriptions","organizations_url":"https://api.github.com/users/IvanMalison/orgs","repos_url":"https://api.github.com/users/IvanMalison/repos","events_url":"https://api.github.com/users/IvanMalison/events{/privacy}","received_events_url":"https://api.github.com/users/IvanMalison/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/IvanMalison/okcupyd/milestones/1","html_url":"https://github.com/IvanMalison/okcupyd/milestones/v1.0.0","labels_url":"https://api.github.com/repos/IvanMalison/okcupyd/milestones/1/labels","id":1230192,"number":1,"title":"v1.0.0","description":"okcupid has made major changes to their website which means that significant changes are needed in okcupyd. This milestone tracks the adaptation to these changes.","creator":{"login":"IvanMalison","id":1246619,"avatar_url":"https://avatars.githubusercontent.com/u/1246619?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanMalison","html_url":"https://github.com/IvanMalison","followers_url":"https://api.github.com/users/IvanMalison/followers","following_url":"https://api.github.com/users/IvanMalison/following{/other_user}","gists_url":"https://api.github.com/users/IvanMalison/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanMalison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanMalison/subscriptions","organizations_url":"https://api.github.com/users/IvanMalison/orgs","repos_url":"https://api.github.com/users/IvanMalison/repos","events_url":"https://api.github.com/users/IvanMalison/events{/privacy}","received_events_url":"https://api.github.com/users/IvanMalison/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":1,"state":"open","created_at":"2015-07-28T20:06:34Z","updated_at":"2015-08-10T23:49:45Z","due_on":null,"closed_at":null},"comments":49,"created_at":"2015-07-16T13:32:02Z","updated_at":"2015-08-11T01:05:50Z","closed_at":null,"body":"Two days or so ago, search requests were working fine. Then all of a sudden they changed. Now:\r\n\r\n    profiles = u.search(age_min=33,age_max=33,height_min=60,height_max=70,radius=10,last_online='month',order_by='match')\r\n    for p in profiles:\r\n        pass\r\n\r\nproduces a long exception trace ending with:\r\n\r\n    .../site-packages/okcupyd/search.pyc in fetch(self, start_at, count)\r\n        279                                          params=search_parameters)\r\n        280         try:\r\n    --> 281             search_html = response.json()['html']\r\n        282         except:\r\n        283             log.warning(simplejson.dumps({'failure': response.content}))\r\n\r\n    .../site-packages/requests/models.pyc in json(self, **kwargs)\r\n        791                     # used.\r\n        792                     pass\r\n    --> 793         return json.loads(self.text, **kwargs)\r\n        794 \r\n        795     @property\r\n\r\n    .../site-packages/simplejson/__init__.pyc in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, use_decimal, **kw)\r\n        503             parse_constant is None and object_pairs_hook is None\r\n        504             and not use_decimal and not kw):\r\n    --> 505         return _default_decoder.decode(s)\r\n        506     if cls is None:\r\n        507         cls = JSONDecoder\r\n\r\n    .../site-packages/simplejson/decoder.pyc in decode(self, s, _w, _PY3)\r\n        368         if _PY3 and isinstance(s, binary_type):\r\n        369             s = s.decode(self.encoding)\r\n    --> 370         obj, end = self.raw_decode(s)\r\n        371         end = _w(s, end).end()\r\n        372         if end != len(s):\r\n\r\n    .../site-packages/simplejson/decoder.pyc in raw_decode(self, s, idx, _w, _PY3)\r\n        398             elif ord0 == 0xef and s[idx:idx + 3] == '\\xef\\xbb\\xbf':\r\n        399                 idx += 3\r\n    --> 400         return self.scan_once(s, idx=_w(s, idx).end())\r\n\r\n    JSONDecodeError: Expecting value: line 3 column 1 (char 3)\r\n\r\nI haven't been banned; other sorts of requests from the same account and IP still work fine. The normal web interface (accessed in a browser) has started looking different too.\r\n"},"comment":{"url":"https://api.github.com/repos/IvanMalison/okcupyd/issues/comments/129661333","html_url":"https://github.com/IvanMalison/okcupyd/issues/63#issuecomment-129661333","issue_url":"https://api.github.com/repos/IvanMalison/okcupyd/issues/63","id":129661333,"user":{"login":"IvanMalison","id":1246619,"avatar_url":"https://avatars.githubusercontent.com/u/1246619?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanMalison","html_url":"https://github.com/IvanMalison","followers_url":"https://api.github.com/users/IvanMalison/followers","following_url":"https://api.github.com/users/IvanMalison/following{/other_user}","gists_url":"https://api.github.com/users/IvanMalison/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanMalison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanMalison/subscriptions","organizations_url":"https://api.github.com/users/IvanMalison/orgs","repos_url":"https://api.github.com/users/IvanMalison/repos","events_url":"https://api.github.com/users/IvanMalison/events{/privacy}","received_events_url":"https://api.github.com/users/IvanMalison/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T01:05:50Z","updated_at":"2015-08-11T01:05:50Z","body":"> Thanks Ivan, I grok decorate_all itself, and this is helping me with the decide methods, which are some of the trickiest parts of the code to master (and I do need to invoke non-default ones, and define some new ones). So would it make sense for us to declare all the factory blah_decider methods on class Filters as @classmethods?\r\n\r\nThey can't be declared on Filters as classmethods, because when you access them like\r\n\r\n`Filters.any_not_none` or `filters_instance.any_not_none` they will already be bound to the filters class at that point. We want the cls variable to get bound to the Filter (not Filters) instance, so we need the classmethod decorated function to still be in raw descriptor form.\r\n\r\nI know you arent the biggest fan of cached_properties, but that would be one way to handle this. Alternatively we could write a simple wrapper descriptor decorator that would prevent these things from getting decorated, or we could just define them at the top level of the filter.py file. All of these are strange in their own way. I havent decided which one is the least bad yet.\r\n\r\n> Would it also make sense for us to modify Filters._handle_decide in filter.py to look like this:\r\n> \r\n> def _handle_decide(self, builder, kwargs):\r\n>     if len(inspect.getargspec(builder.decide).args) == 3:\r\n>         return builder.decide(builder.transform, kwargs, builder.keys)\r\n>     else:\r\n>         return builder.decide(kwargs)\r\n> Formerly the clauses were reversed, and the test was for whether the argspec(...).args == 2. (Why was it 2, when decide is a staticmethod? is this because of some metaclass voodoo?)\r\n\r\nHmmm. yeah good point. This is where the classmethod/staticmethod thing gets confusing. The reason the check was two does have to do with the metaclass magic. I think the real answer is just to get rid of all of the legacy deciders.\r\n\r\nWe may need to write a function that wraps getargspec and doesnt return the bound parameter...\r\n\r\n> \r\n> Thanks for answering all the questions above. It helped a lot. Some things are still fuzzy, but this should be enough for me to at least push some code to my fork. Any further misunderstandings on my part will probably show themselves when you audit it.\r\n\r\nIt seems like you have a pretty good grasp of things now. Let me see if I can get search actually working, so we can start testing the filters.\r\n\r\n"}}