Closed depthfirst closed 8 years ago
Did you merge in the change to Story.init?
On Wed, Nov 25, 2015 at 5:37 PM John Blackmore notifications@github.com wrote:
Merged #5 https://github.com/MrTyton/Fanfiction/pull/5.
— Reply to this email directly or view it on GitHub https://github.com/MrTyton/Fanfiction/pull/5#event-475036253.
Whatever you changed in master
So... how do I use this?
When you have the story object, call get_chapter_text(). This will populate a dictionary in the story object called chapter_texts, where the key is the chapter (starting from 1) and the value is the chapter itself. There's a lot of HTML formatting in there though... If a chapter couldn't be gotten (because of bad sockets or whatever) it just skips it, and the key isn't in the dictionary.
On Wed, Nov 25, 2015 at 5:52 PM John Blackmore notifications@github.com wrote:
So... how do I use this?
— Reply to this email directly or view it on GitHub https://github.com/MrTyton/Fanfiction/pull/5#issuecomment-159749573.
Er... I forgot to push the init change.
On Wed, Nov 25, 2015 at 6:02 PM Joshua Gang joshua.gang@gmail.com wrote:
When you have the story object, call get_chapter_text(). This will populate a dictionary in the story object called chapter_texts, where the key is the chapter (starting from 1) and the value is the chapter itself. There's a lot of HTML formatting in there though... If a chapter couldn't be gotten (because of bad sockets or whatever) it just skips it, and the key isn't in the dictionary.
On Wed, Nov 25, 2015 at 5:52 PM John Blackmore notifications@github.com wrote:
So... how do I use this?
— Reply to this email directly or view it on GitHub https://github.com/MrTyton/Fanfiction/pull/5#issuecomment-159749573.
Ok went and pulled the change for you... with a description
On Wed, Nov 25, 2015 at 6:04 PM Joshua Gang joshua.gang@gmail.com wrote:
Er... I forgot to push the init change.
On Wed, Nov 25, 2015 at 6:02 PM Joshua Gang joshua.gang@gmail.com wrote:
When you have the story object, call get_chapter_text(). This will populate a dictionary in the story object called chapter_texts, where the key is the chapter (starting from 1) and the value is the chapter itself. There's a lot of HTML formatting in there though... If a chapter couldn't be gotten (because of bad sockets or whatever) it just skips it, and the key isn't in the dictionary.
On Wed, Nov 25, 2015 at 5:52 PM John Blackmore notifications@github.com wrote:
So... how do I use this?
— Reply to this email directly or view it on GitHub https://github.com/MrTyton/Fanfiction/pull/5#issuecomment-159749573.
I don't have a story object. This seems complicated. All I really want is the full text, don't care about chapters.
The full text is going to just be all of the chapters together. The actual function that gets the chapter texts is first scrapePage.openStoryPage(url), followed by an indexer. Each of the chapters is a different URL so I had to do them one at a time.
Story object is because that's where it just seemed to make the most sense in the framework that I'd already made. If you want you can just change all of the arguments except for the storyID to be optional, or just try and call the function directly...
On Wed, Nov 25, 2015 at 6:11 PM John Blackmore notifications@github.com wrote:
I don't have a story object. This seems complicated. All I really want is the full text, don't care about chapters.
— Reply to this email directly or view it on GitHub https://github.com/MrTyton/Fanfiction/pull/5#issuecomment-159752345.
Now supports getting the text of the story, extended from the Story class. Should probably put a different init function in, where you give it all of the information to begin with instead of scraping it from the page.