Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day One 2 breaks exporter #29

Open
davemee opened this issue Feb 5, 2016 · 8 comments
Open

Day One 2 breaks exporter #29

davemee opened this issue Feb 5, 2016 · 8 comments

Comments

@davemee
Copy link

davemee commented Feb 5, 2016

The application storage has both changed names, and deprecated features - iCloud and Dropbox are no longer supported.

@pwaldhauer
Copy link
Owner

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?

@davemee
Copy link
Author

davemee commented Feb 6, 2016

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.

@davemee
Copy link
Author

davemee commented Feb 6, 2016

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?

@pwaldhauer
Copy link
Owner

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

@davemee
Copy link
Author

davemee commented May 25, 2016

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!

@blueneogeo
Copy link

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

@davemee
Copy link
Author

davemee commented Dec 8, 2016

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.

@blueneogeo
Copy link

blueneogeo commented Dec 12, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants