{"action":"created","issue":{"url":"https://api.github.com/repos/pilight/pilight/issues/189","labels_url":"https://api.github.com/repos/pilight/pilight/issues/189/labels{/name}","comments_url":"https://api.github.com/repos/pilight/pilight/issues/189/comments","events_url":"https://api.github.com/repos/pilight/pilight/issues/189/events","html_url":"https://github.com/pilight/pilight/pull/189","id":101028421,"number":189,"title":"Add pilight-receive datetime filtering.","user":{"login":"pilino1234","id":11665015,"avatar_url":"https://avatars.githubusercontent.com/u/11665015?v=3","gravatar_id":"","url":"https://api.github.com/users/pilino1234","html_url":"https://github.com/pilino1234","followers_url":"https://api.github.com/users/pilino1234/followers","following_url":"https://api.github.com/users/pilino1234/following{/other_user}","gists_url":"https://api.github.com/users/pilino1234/gists{/gist_id}","starred_url":"https://api.github.com/users/pilino1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pilino1234/subscriptions","organizations_url":"https://api.github.com/users/pilino1234/orgs","repos_url":"https://api.github.com/users/pilino1234/repos","events_url":"https://api.github.com/users/pilino1234/events{/privacy}","received_events_url":"https://api.github.com/users/pilino1234/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-08-14T14:57:39Z","updated_at":"2015-08-15T10:06:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pilight/pilight/pulls/189","html_url":"https://github.com/pilight/pilight/pull/189","diff_url":"https://github.com/pilight/pilight/pull/189.diff","patch_url":"https://github.com/pilight/pilight/pull/189.patch"},"body":"This filters the pilight-receive output and removes the JSON objects for the datetime protocol. Invoke pilight-receive with pilight-receive -F to use."},"comment":{"url":"https://api.github.com/repos/pilight/pilight/issues/comments/131323655","html_url":"https://github.com/pilight/pilight/pull/189#issuecomment-131323655","issue_url":"https://api.github.com/repos/pilight/pilight/issues/189","id":131323655,"user":{"login":"pilino1234","id":11665015,"avatar_url":"https://avatars.githubusercontent.com/u/11665015?v=3","gravatar_id":"","url":"https://api.github.com/users/pilino1234","html_url":"https://github.com/pilino1234","followers_url":"https://api.github.com/users/pilino1234/followers","following_url":"https://api.github.com/users/pilino1234/following{/other_user}","gists_url":"https://api.github.com/users/pilino1234/gists{/gist_id}","starred_url":"https://api.github.com/users/pilino1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pilino1234/subscriptions","organizations_url":"https://api.github.com/users/pilino1234/orgs","repos_url":"https://api.github.com/users/pilino1234/repos","events_url":"https://api.github.com/users/pilino1234/events{/privacy}","received_events_url":"https://api.github.com/users/pilino1234/received_events","type":"User","site_admin":false},"created_at":"2015-08-15T10:06:35Z","updated_at":"2015-08-15T10:06:35Z","body":"Seems to work now:\r\n```\r\n\twhile(main_loop) {\r\n\t\tif(socket_read(sockfd, &recvBuff, 0) != 0) {\r\n\t\t\tgoto close;\r\n\t\t}\r\n\t\tchar *protocol = NULL;\r\n\t\tchar **array = NULL;\r\n\t\tint filtered = 0;\r\n\t\tunsigned int n = explode(recvBuff, \"\\n\", &array), i = 0;\r\n\r\n\t\tfor(i=0;i<n;i++) {\r\n\t\t\tstruct JsonNode *jcontent = json_decode(array[i]);\r\n\t\t\tstruct JsonNode *jtype = json_find_member(jcontent, \"type\");\r\n\t\t\tif(jtype != NULL) {\r\n\t\t\t\tjson_remove_from_parent(jtype);\r\n\t\t\t\tjson_delete(jtype);\r\n\t\t\t}\r\n\t\t\tif(filteropt == 1) {\r\n\t\t\t\tchar **filters = NULL;\r\n\t\t\t\tunsigned int m = explode(filter, \",\", &filters), j = 0;\r\n\t\t\t\tjson_find_string(jcontent, \"protocol\", &protocol);\r\n\t\t\t\tfor(j=0;j<m;j++) {\r\n\t\t\t\t\tif(strcmp(filters[j], protocol) == 0) {\r\n\t\t\t\t\t\tfiltered = 1;\r\n\t\t\t\t\t\tarray_free(&filters, m);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(filtered == 0) {\r\n\t\t\t\t\tchar *content = json_stringify(jcontent, \"\\t\");\r\n\t\t\t\t\tprintf(\"%s\\n\", content);\r\n\t\t\t\t\tjson_free(content);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tchar *content = json_stringify(jcontent, \"\\t\");\r\n\t\t\t\tprintf(\"%s\\n\", content);\r\n\t\t\t\tjson_free(content);\r\n\t\t\t}\r\n\t\t\tjson_delete(jcontent);\r\n\t\t}\r\n\t\tarray_free(&array, n);\r\n\t}\r\n```\r\nAnything else I need to do?"}}