Giter VIP home page Giter VIP logo

Comments (8)

pwaldhauer avatar pwaldhauer commented on July 24, 2024

Yeah, sorry.

Since I have no plans on buying Day One 2 I won't be able to bake in support for that, sorry. Maybe someone else could do a bit of research on the new data format and if it's even possible to create new posts from external sources?

from elizabeth.

davemee avatar davemee commented on July 24, 2024

Hey, thanks for the reply!

I think I can make the fix, but I'm not so familiar with how how Elizabeth is structured - if you could answer a couple of questions I'll have, I'd be happy to add in a Day One 2 exporter.

from elizabeth.

davemee avatar davemee commented on July 24, 2024

I've forked it and created a DayOne2Export.js, butchered from your DayOneExport.js.

However, I'm a little over my head - I'm getting an error you might be able to shed some light on.

invalid document source 
@#[line:0,col:undefined]
/usr/local/lib/node_modules/elizabeth/node_modules/dayone/node_modules/plist/lib/parse.js:45
  if (doc.documentElement.nodeName !== 'plist') {
         ^

TypeError: Cannot read property 'documentElement' of undefined
    at Object.parse (/usr/local/lib/node_modules/elizabeth/node_modules/dayone/node_modules/plist/lib/parse.js:45:10)
    at DayOneEntry.fromOutputFormat [as fromFile] (/usr/local/lib/node_modules/elizabeth/node_modules/dayone/lib/DayOneEntry.js:58:23)
    at /usr/local/lib/node_modules/elizabeth/node_modules/dayone/lib/DayOne.js:49:19
    at Array.forEach (native)
    at DayOne.list (/usr/local/lib/node_modules/elizabeth/node_modules/dayone/lib/DayOne.js:47:30)
    at DefaultPlugin.loadEntries (/usr/local/lib/node_modules/elizabeth/lib/output/DayOne2Export.js:201:17)
    at DefaultPlugin.exportDay (/usr/local/lib/node_modules/elizabeth/lib/output/DayOne2Export.js:75:8)
    at /usr/local/lib/node_modules/elizabeth/lib/Elizabeth.js:143:17
    at Request._callback (/usr/local/lib/node_modules/elizabeth/node_modules/moves-api/lib/MovesApi.js:126:13)
    at Request.self.callback (/usr/local/lib/node_modules/elizabeth/node_modules/request/request.js:123:22)

when I tell it to use the new exporter (which I know it's pulling in - I have it dump out 'this' around line 198 inside loadEntries() which gives me this:

davem$ ellie export --dayStart 20160201 --dayEnd 20160204
Welcome to Elizabeth, your Moves.app exporter!
----------------------------------------------

> Using DayOne2Export to export 3 days!

> Using DayOne2 directory: /Users/davem/Library/Group Containers/5U8NS4GX82.dayoneapp2/Data/Auto Import/Default Journal.dayone/

DefaultPlugin {
  help: 
   { name: 'DayOne2Export',
     description: 'Exports into your Day One 2',
     options: 
      { directory: 'DayOne 2 data directory. (default: auto, only works with Day One 2 Mobile Import)',
        overwrite: 'Overwrite existing imported entries. If set to false they will be skipped. (default: false)',
        tag: 'The unique tag that will be added to the generated entries. (default: moves-import)',
        timezone: 'Timezone for new entries. (default: Europe/London)' } },
  options: 
   { directory: '/Users/davem/Library/Group Containers/5U8NS4GX82.dayoneapp2/Data/Auto Import/Default Journal.dayone/',
     overwrite: false,
     tag: 'moves-import',
     timezone: 'Europe/London',
     output: 'DayOne2Export',
     outputFile: '%date%_plaintext.txt',
     days: '7' },
  entryCache: null,
  dayOne: 
   DayOne {
     options: { directory: '/Users/davem/Library/Group Containers/5U8NS4GX82.dayoneapp2/Data/Auto Import/Default Journal.dayone/' } },
  gmap: 
   DefaultPlugin {
     help: 
      { name: 'GoogleMapExport',
        description: 'Exports as a static google map',
        options: [Object] },
     options: 
      { outputFile: '%date%.png',
        dateFormat: 'YYYYMMDD',
        size: '800x450',
        zoomFactor: 13,
        format: 'jpg',
        addPlaces: true } } }

Any ideas?

from elizabeth.

pwaldhauer avatar pwaldhauer commented on July 24, 2024

Elizabeth uses my DayOne library to read/write entries. I think you need to bake in DO2 support there first:

https://github.com/pwaldhauer/dayone

from elizabeth.

davemee avatar davemee commented on July 24, 2024

Thanks Philipp,

You're absolutely right, of course. You also know I have 3 months of Moves data I've not imported yet! :)

It was a fairly simple tweak to get your Day One importer to support Day One (1) and Day One 2 - just running some checks and then I'll pop the changes over there.

Thanks again!

from elizabeth.

blueneogeo avatar blueneogeo commented on July 24, 2024

Hi dave, did you ever complete those checks and get it to work?

from elizabeth.

davemee avatar davemee commented on July 24, 2024

I was in deeper than I hoped to be, @blueneogeo. In the end, I just symlinked the Day One 2 import folder (I think it's in ~/Library/Day One 2/ somewhere) to the Day One 1 import folder, and it carried on fine.

For a while, anyway - something else has snagged for me and I need to look into it properly. Try the symlink for a quick solution that might work, though.

from elizabeth.

blueneogeo avatar blueneogeo commented on July 24, 2024

from elizabeth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.