darchualMTS

Member +
  • Content count

    14
  • Joined

  • Last visited

Community Reputation

2 Neutral

About darchualMTS

  1. Here is my code for C#: // Create a filter for retrieving notes NoteFilter filter = new NoteFilter(); // Set guid of notebook to only retrieve notes for the current notebook filter.NotebookGuid = notebook.Guid; // Get 999 notes in this notebook NoteList notes = noteStore.findNotes(authToken, filter, 0, 999); // loop through notes in this notebook foreach (Note note in notes.Notes)
  2. I found a solution: // get all info for the attachment Resource attachment = resource; String attachmentExtension = attachment.Attributes.FileName.Split('.').Last().Trim(); Resource resourceData = noteStore.getResource(authToken, attachment.Guid, true, false, true, true);... newContent.ATTACHMENT = new System.Data.Linq.Binary(resourceData.Data.Body); Thanks.
  3. I am trying to save the contents of an EverNote note into my database. The problem is, resource->body doesn't seem to contain any data. It just gives me Byte[]. Resource attachment = note.Resources.FirstOrDefault(); String attachmentExtension = attachment.Attributes.FileName.Split('.').Last().Trim(); Resource resource = noteStore.getResource(authToken, attachment.Guid, true, false, true, true); ATTACHMENTS_CONTENT newContent = new ATTACHMENTS_CONTENT(); newContent.ID = Guid.NewGuid(); newContent.ATTACHMENT_ID = newAttachment.ID; newContent.DESCRIPTION = "Uploaded " + attachment.Attributes.FileName + " on " + DateTime.Now.ToShortDateString(); newContent.FILENAME = attachment.Attributes.FileName; newContent.FILE_EXT = attachmentExtension; newContent.FILE_MIME_TYPE = attachment.Mime; newContent.DATE_ENTERED = DateTime.Now; newContent.DATE_MODIFIED = DateTime.Now; newContent.ATTACHMENT = resource.Data.Body; //Console.WriteLine(newContent.ATTACHMENT); Console.WriteLine(resource.Data.Body); How can I access the resources data and save it to my database? Thank you. Edit: I have been looking at this http://dev.evernote.com/start/core/resources.php#downloading but I can't see what I'm doing wrong...
  4. I found a cleaner solution, after all: static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); static readonly double MaxUnixSeconds = (DateTime.MaxValue - UnixEpoch).TotalSeconds; public static DateTime UnixTimeStampToDateTime(double unixTimeStamp) { return unixTimeStamp > MaxUnixSeconds ? UnixEpoch.AddMilliseconds(unixTimeStamp).ToLocalTime() : UnixEpoch.AddSeconds(unixTimeStamp).ToLocalTime(); }
  5. I didn't want to put that dirty code in my beautiful app, but it looks like it's the only way! thanks for your help. I would like a cleaner solution, however.
  6. Even when I do: DateTime dtCloud = new DateTime(nt.Created * 1000 * 10); As per http://discussion.evernote.com/topic/28207-how-to-get-the-date-created-of-a-note/ It fails by giving me an improper date: 3/5/0044 3:54:37 PM How can I convert this to a proper C# datetime object; do you know? Thanks. Edit: I have also tried: new DateTime(note.Updated, DateTimeKind.Utc); Which gives me another improper date: 1/2/0001 1:50:49 PM
  7. Looks like note.updated will get me what I want. Does anyone know why I can't do this? Datetime date = new Datetime(note.updated); It doesn't format the proper date. It gives me 0/00/00 1:24:08 It doesn't look like it gives me the actual date...
  8. I am trying to sync EverNote notes to my Application's notes, and to do so, it would be helpful if I could figure out which notes where updated last. Is there a way to check the date the EverNote Note was last modified/ edited/ updated/ changed? Thanks for your help.
  9. I didn't know that, thanks (that stacks would be created automatically if they didn't already exist). Does it work for notebooks like that, too? For instance, if I add a note to a notebook that doesn't exist, will it create it for me? It doesn't appear so, as I have to specify a notebook Guid, not a name.
  10. Thanks, Kentaro; but won't this just assign a notebook to a stack? I want to actually create a new stack to which I may assign various notebooks. Does that make sense?
  11. I am trying to create the following structure: (stack) Main Folder - (notebook) Notebook1 - (notebook) Notebook2 - etc. How can I create a stack with the API? I can create notebooks like this: // **************************** // CREATE NOTEBOOK // **************************** Notebook facts = new Notebook(); facts.Name = "FACTS"; Notebook createdFacts = noteStore.createNotebook(authToken, facts); Console.WriteLine("Successfully created new notebook with GUID: " + createdFacts.Guid); But, how can I create a stack for my notebooks? Thanks for your help.
  12. Thanks for your help.
  13. Kentaro, thanks for your response. But, I am having trouble locating the syntax. Do you have an example of how to do this in C#? All I found is this, but I don't seem to be able to filter by "name," as you said, just Guid: //--Create a filter for retrieving notes NoteFilter filter = new NoteFilter(); //--Set guid of notebook to only retrieve notes for the current notebok filter.NotebookGuid = notebook.Guid; //--Get notes NoteList notes = noteStore.findNotes(authToken, filter, 0, 1); //--List note titles foreach (Note note in notes.Notes) { Console.WriteLine("Found note: " + note.Title); Console.WriteLine("GUID: " + note.Guid); Console.WriteLine(noteStore.getNoteContent(authToken, note.Guid)); // This line show note(s) content successfully for me. }
  14. I am trying to get all notes in a specific notebook (in this case, ones that match "FACTS"). The only way I know how is to manually do this: // List all of the notebooks in the user's account List<Notebook> notebooks = noteStore.listNotebooks(authToken); List<Guid> factsNotebooks = new List<Guid>(); Console.WriteLine("Found " + notebooks.Count + " notebooks:"); foreach (Notebook notebook in notebooks) { if (notebook.Name.IndexOf("FACTS") > -1) { factsNotebooks.Add(new Guid(notebook.Guid)); } } Is there a better way with the API? I am new to EverNote's API (and EverNote, in general).