PiMaker / MonikAI

Monika from DDLC keeping you company on your desktop!
MIT License
92 stars 38 forks source link

Automatically load Spreadsheet #7

Closed PiMaker closed 6 years ago

PiMaker commented 6 years ago

Implement loading an online version of responses on startup.

Probably will have to export the spreadsheet as csv or similar...

TODO: Direct GDocs loading? GitHub releases? Personal server?

PiMaker commented 6 years ago

After careful consideration I think the best idea would be to create tags on GitHub and upload curated CSV exports of the GDocs spreadsheet there. The application can then load all available tags from GitHub on startup and if it's newer than the local one it downloads the latest CSV and saves it somewhere to disk.

The CSV should be loaded through some sort of helper class, to avoid code repetition in different Behaviour classes.

bwroberts48 commented 6 years ago

I'll see what I can do about inputting from the CSV. I was thinking about doing semi-colon delimiters so the program wouldn't be disrupted by punctuation (Assuming we can keep our text "semi-colon free").

I'm not very familiar with how GitHub and how loading tags from it into the program would work however. Do you have any reference material I can study up on as far as that goes? @PiMaker

PiMaker commented 6 years ago

One could take a look at this: https://github.com/octokit/octokit.net Seems like that would make interfacing with GitHub easier. I will create a sample tag and upload a CSV for testing. Semicolon-Seperated sounds good, that's still called a CSV though.

PiMaker commented 6 years ago

Also, BTW, @bwroberts48 are you /u/DolphinsScareMe on reddit by chance?

bwroberts48 commented 6 years ago

Awesome, i'll take a look at that in the morning!

And I am indeed @PiMaker

bwroberts48 commented 6 years ago

Okay got a good idea for building this and will focus on building a prototype tomorrow, mind assigning me to the issue so I can receive any updates from this thread? @PiMaker

PiMaker commented 6 years ago

Alright, I have no clue how to assign you the issue, it doesn't let me from the dropdown I get... Anyway, you should receive updates to this thread anyway, because you are mentioned (@bwroberts48) in it? Once you have a prototype you can create a pull request from a fork of yours, that should allow me to merge your code into the main repo.

I thought about also adding in a general update functionality. Although I feel like that should be a seperate part anyway. Have you focused your prototype idea more on parsing the CSV or downloading updates from GitHub? Because if you want we could split up that task, so I can take on one or the other as well.

bwroberts48 commented 6 years ago

Okay, maybe there's a way to assign myself! I'm very unfamiliar with this platform so if I get updates then it sounds good! And i'm focusing currently on the parsing the CSV to start with, if you could figure out downloading updates from GitHub so we can combine when i'm finished that would be very helpful.

And for future reference here's a quick process I found for assigning users as the owner of the project: https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/ @PiMaker

PiMaker commented 6 years ago

Sounds like a plan. For the format of the CSV, if you could somewhat base that on the spreadsheet already on Google Docs that would be very helpful, as it would minimize effort to create a new version from new entries in there.

bwroberts48 commented 6 years ago

Yeah, what I did is I exported the Google Docs to a CSV file after swapping the delimiter to a semi-colon and I've been testing my code with that. I just now got it working so I can store the code as members in structs. Tomorrow (hopefully) i'll perfect that and figure out how your code works so I can start working on her reading in the behaviours

PiMaker commented 6 years ago

The interesting part is going to be how to integrate my browser process instance detection function to avoid detecting multiple processes in one single browser instance. I think that will have to be a hardcoded edge-case for now, as long as you don't figure out some magical solution. (You'll see once you take a look at my code)

bwroberts48 commented 6 years ago

Okay so I've got it down a basic thing to be able to read the information into my struct the main issue i'll have now is integrating my C++ into your C# so that I can finish it up by making the function so MonikAI can read it @PiMaker

zchaudhry11 commented 6 years ago

I apologize for entering the thread late. I started created a csv parser the first day I saw the repository but the code was messy and I did not get a chance to improve it until today but I saw that it was already being worked on. I've submitted a PR with the changes that I made but my code is in C#. Is there any reason why the parser needs to be done in C++? It seems like using unmanaged code with the core codebase might make things more complicated to change and extend in the future.

@bwroberts48 Is your code posted anywhere? We can work together to convert it to C# in case my code isn't up to par with the rest of the repository (although if that's the case, I don't think you'd want my help!)

I linked my parser to the ApplicationBehavior class and from the testing I did everything seems to be working fine. I will take a look at linking it to the WebBrowserBehavior next if there are no issues to resolve.

On a side note, the auto updater seems to be broken for me. For some reason, whenever I run MonikAI, the auto updater immediately maxes out the 60 hourly GitHub API requests that I can make. I will investigate this issue further at a later time.

bwroberts48 commented 6 years ago

@zchaudhry11 Only reason I was writing in C++ was because I don't know C# so your code makes the process a lot easier. I'm a novice to programming so I'll look at your code but I bet it's more elegant than mine

zchaudhry11 commented 6 years ago

I'm not a professional by any means so feel free to make any corrections if something looks problematic or ask any questions if you have any.

C# is an amazing programming language and you should give it a shot since there's no better way to learn than diving head first into a new codebase!

PiMaker commented 6 years ago

Merged the pull request from @zchaudhry11 and implemented the remaining few bits myself. Thank you all!