Skip to content

Instantly share code, notes, and snippets.

@MDIB
Created December 23, 2018 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MDIB/9132a415aa2f60a219380252fc1b1035 to your computer and use it in GitHub Desktop.
Save MDIB/9132a415aa2f60a219380252fc1b1035 to your computer and use it in GitHub Desktop.
JSON.stringify($.map($('.expense .summary .involved'),
(e) => {
var negative = $(e).find('.you > .negative').text()
var positive = $(e).find('.you > .positive').text()
var date = $(e).find('.date').prop('title')
var isPositive = (negative == "")
var final = isPositive?positive:negative
var desc = $(e).find('.description').text()
return {amount: final,
desc: desc.trim(),
date: date}
}))
@MDIB
Copy link
Author

MDIB commented Oct 6, 2019

JSON.stringify($.map($('.transaction'),
(e) => { 
        var desc = $(e).find('.description').text()
        var amount = $(e).find('.amount').text().replace(/R\$/g,"").trim()
         return {amount: amount,
                 desc: desc.trim()}
       }))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment