{"action":"created","issue":{"url":"https://api.github.com/repos/mawrkus/jason-the-miner/issues/5","repository_url":"https://api.github.com/repos/mawrkus/jason-the-miner","labels_url":"https://api.github.com/repos/mawrkus/jason-the-miner/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/mawrkus/jason-the-miner/issues/5/comments","events_url":"https://api.github.com/repos/mawrkus/jason-the-miner/issues/5/events","html_url":"https://github.com/mawrkus/jason-the-miner/issues/5","id":298031302,"number":5,"title":"Parse more levels (at least one more) and add conditions to optimize parsing","user":{"login":"juanmaguitar","id":422576,"avatar_url":"https://avatars1.githubusercontent.com/u/422576?v=4","gravatar_id":"","url":"https://api.github.com/users/juanmaguitar","html_url":"https://github.com/juanmaguitar","followers_url":"https://api.github.com/users/juanmaguitar/followers","following_url":"https://api.github.com/users/juanmaguitar/following{/other_user}","gists_url":"https://api.github.com/users/juanmaguitar/gists{/gist_id}","starred_url":"https://api.github.com/users/juanmaguitar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanmaguitar/subscriptions","organizations_url":"https://api.github.com/users/juanmaguitar/orgs","repos_url":"https://api.github.com/users/juanmaguitar/repos","events_url":"https://api.github.com/users/juanmaguitar/events{/privacy}","received_events_url":"https://api.github.com/users/juanmaguitar/received_events","type":"User","site_admin":false},"labels":[{"id":307270853,"url":"https://api.github.com/repos/mawrkus/jason-the-miner/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-02-17T19:50:27Z","updated_at":"2018-03-03T10:29:58Z","closed_at":null,"author_association":"NONE","body":"To expand the capabilities of the configuration it would be great to be able to use a JS object (just like webpack does)\r\n\r\nWith this, it would be great to express in the config more levels (at least one more) of parsing and add conditions to optimize parsing. Something like this:\r\n\r\n```javascript\r\nquotes = {\r\n  \"_$\": \".quoteDetails\",\r\n  text: \".quoteText < regexp:([^―]+) | trim\",\r\n  numLikes: {\r\n    selector: \".quoteFooter .smallText\",\r\n    parse: text => +text.replace(/\\D/g,'') // to get the number out of the text \r\n  },\r\n  author: {\r\n    name: \".quoteText > .authorOrTitle\",\r\n    details: {\r\n      link: \".quoteText > .authorOrTitle\",\r\n      data: {\r\n        \"description\": \".aboutAuthorInfo span:nth-child(2)\"\r\n      }\r\n    }\r\n  },\r\n  tags: \".quoteFooter .left a\",\r\n  filter: () => quotes.numLikes > 30 // will parse details page only if this condition is met\r\n}\r\n```\r\nthe `details` property will be another object w/ the `description` property, which value will be got by parsing another page (`href` got from the link in the `link` selector)\r\n\r\nwe can also add a parse function so we can manipulate directly the data got from parsing. For example, getting the number in `numLikes` from the text got in parsing \r\n\r\nwe can also add a`filter` function so no further parsings are done if the condition expressed is not met\r\n\r\nThis is just a wish list. I could help with these ones if you want.\r\n\r\nBesides this. Amazing job w/ this tool!! Congratulations!!"},"comment":{"url":"https://api.github.com/repos/mawrkus/jason-the-miner/issues/comments/370137187","html_url":"https://github.com/mawrkus/jason-the-miner/issues/5#issuecomment-370137187","issue_url":"https://api.github.com/repos/mawrkus/jason-the-miner/issues/5","id":370137187,"user":{"login":"juanmaguitar","id":422576,"avatar_url":"https://avatars1.githubusercontent.com/u/422576?v=4","gravatar_id":"","url":"https://api.github.com/users/juanmaguitar","html_url":"https://github.com/juanmaguitar","followers_url":"https://api.github.com/users/juanmaguitar/followers","following_url":"https://api.github.com/users/juanmaguitar/following{/other_user}","gists_url":"https://api.github.com/users/juanmaguitar/gists{/gist_id}","starred_url":"https://api.github.com/users/juanmaguitar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanmaguitar/subscriptions","organizations_url":"https://api.github.com/users/juanmaguitar/orgs","repos_url":"https://api.github.com/users/juanmaguitar/repos","events_url":"https://api.github.com/users/juanmaguitar/events{/privacy}","received_events_url":"https://api.github.com/users/juanmaguitar/received_events","type":"User","site_admin":false},"created_at":"2018-03-03T10:29:58Z","updated_at":"2018-03-03T10:29:58Z","author_association":"NONE","body":"ah! oks ;)"}}
{"actor":{"display_login":"juanmaguitar"}}