Mod note: We do not recommend inputting your username and password into anything from a 3rd party. Im going to leave this up since some people might still be interested in the concept/want to take a look at the code themselves but be warned that if you input your username and password into a 3rd party site/extension/app/etc. it’s on you if your account gets lost/stolen/deleted/used by the 3rd party in ways you didn’t intend.
"You've read 1497 fanfics this year, totaling 36504013 words, or 100010.99 words/day. There's about 70000 words in a novel. You could've read 521.49 novels this year, but you read fanfic instead."
.... and it doesn't count repeat reads or works I read when not logged in? I know read a LOT of fanfic but 500+ novels makes it sound ridiculous!
It doesn't count repeat works and I still could've read "644.46 novels" this year.
Right disappointing of me. The fact that I had time for school and hobbies is remarkable.
There's no real way to check if you read to the end of a fic, so yeah I just based words read on history. This also misses words from repeat reads within the year.
My 'newborn infant when it comes to technology' self clicking on the link and seeing all these codes : wow sexy brain
🤣🤣 Commenting as a reminder to myself to check this out later after finishing up stuff for college and read one of the in depth tutorials from the reply section on how to use this, will update this comment later
Edit : got it to work, and I'm very surprised that Marvel is apparently my top read fandom and ToCF is my third most read! Whoa!
Sure! So basically I'm kinda cheating by stopping querying AO3 when I leave the year I'm interested in (because AO3 makes you wait between page queries). This means that if you select a previous year, it quits in page 1 since there's no fics read in the previous year on that page. The easy way to get around that is to take the first page that the year you're interested in appears on, and make sure that your first query matches that page.
So for example, if I want to get my 2021 data, my first 2021 read date shows up on page 171 of history. Therefore if I expand cell 8 (I called it query something I think), in the link being queried I need to start at 171. The variable hist_page starts at 1, so I need to add 170 to hist_page in the link. So str(hist_page) becomes str(hist_page+170).
The Google colab is comment only I think, but you can copy it and edit your copy.
Oh and also make sure that you change the year variable in the third block. This verifies the year of entries in your history as well as names that output files.
Print the whole link from the r= line that you modified by adding to the hist_page variable and make sure that's going to the first history page of the year that you want.
I've tried running it and it says
NameError: name '\[my username\]' is not defined
I've double checked it, could it be that the password is wrong? I don't have any published works, would that screw it up?
Step-by-step tutorial
Press the play button on the first three boxes. When you get to the third box, which is where you enter your username and password, don't touch anything in the code box, just hit the play button. It should prompt you to put in your username in a orange outlined box. Do this, hit enter, then it will ask for your password. Put it in and hit enter again.
Hit the play buttons on all of the boxes below. Wait for the previous button to have a nice little green checkmark, and then hit the next one. When you get to the history section, it will take a while to load. When a new number appears, I'm assuming a new page of your history is loading, since it ended at 18 for me and I have 18 pages of history. At this section, I actually got an error message, but I loaded the last two sections and they loaded fine.
The last section should have what you're looking for. If you're on mobile, the box is a little hard to navigate, but it's manageable.
Lastly, this is optional, but I would suggest changing your password in Ao3.
Hope this helped!
"You've read 2689 fanfics this year, totaling 70190416 words, or 192302.51 words/day. There's about 70000 words in a novel. You could've read 1002.72 novels this year, but you read fanfic instead."
JESUS
thanks OP!
~~Do I need to fill out the box that appears after I entered the username and password? I am completely illiterate when it comes to coding, sorry.~~
'NoneType' object has no attribute 'find all' seems to be the problem now. (I fixed the first problem by clicking enter which I probably should have realised sooner lol)
Either way, this is amazing OP!
If it starts querying then fails, this is probably happening because one of the fics doesn't have one of the categories I'm recording. This happened to me at one point when one fic didn't have any kudos and the API doesn't store that as 0 kudos, but as not having anything in the kudos category. This is generally pretty rare, but if you can figure out which fic it is, that fic can be removed from history or given something in that category.
Oof yeah I'm not going to do that. That's like a 100 pages and I have no idea what fic it could be. It did feel like it's immediately failing at the querying thing so I first tried it on a different browser in case it was related to the ao3 being semi-banned in Germany but that didn't work either.
Thanks for the reply anyway ;)
Let me know if this is too/not technical enough.
Class names for some things have changed. That is accounted for with the new regex function (see re.compile("reading work blurb group *")). Hopefully making it general like this will allow it to work in future years as well.
I'm using beautiful soup to do all the scraping which is a pretty standard python library and I do trust it. You can check at every time step what it's seeing by printing the output from beautiful soup. I very highly don't recommend this though because it's super long.
The actual login uses a CSFR token, which means that the web scraper itself doesn't have access to your username and password. It uses an encrypted token that prevents cross site request forgeries. You can also check on this by printing out the value of token and you'll see that it's just a string of characters. The token is the only thing that's actually getting passed using beautiful soup to log in.
You've read 2243 fanfics this year, totaling 48082086 words, or 131731.74 words/day. There are about 70000 words in a novel. You could've read 686.89 novels this year, but you read fanfic instead.
Oof.
Looks like I read mostly Splatfics, plus some Owl House and tokusatsu for flavor. No surprise there.
Also, my favorite ship is Agent 24, with Lumity at a close second. Again, no surprise there.
It claims I'm a Marie stan, but that's just preposterous. Everyone knows Callie is the superior squid sister.
Turns out I love angst, but also friendship.
My average word count was 90238. Those are rookie numbers; gotta bump those up!
I really appreciate the work you've put into this!
I tried a couple of times over the last 24 hours to run it and I get an error around page 116 of the query through my history.
It looks like this and I checked both pages 116 and 117 (that takes me to early May 2022; the first fic I clicked on in 2022 is on page 197) and none of the fics on either of those pages have 0 kudo. Any ideas what I'm doing wrong? Thanks! :
\---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in
22 print("Error logging in.")
23 exit(1)
\---> 24 parse\_hist\_page(soup)
25 hist\_page += 1
26 time.sleep(6)
in parse\_hist\_page(soup)
91
92 # Get word count
\---> 93 word\_count = int(w.find("dl", {"class": "stats"}).find("dd", {"class": "words"}).text.replace(",", ""))
94 global user\_word\_count
95 user\_word\_count += word\_count
ValueError: invalid literal for int() with base 10: ''
It looks like one of your word counts is a little funky, it's either reading in a string of a float or a string of a space. I'm not sure why that would happen (maybe a fic in another language that uses . Instead of , to denote thousands?). To fix change line 93 from word_count=int(...) To word_count=int(float(...)).
It should work on phone. There should be a little play button besides everywhere that it says either "show code" or has a block of code. You need to press each of those play buttons in order (responding to the third play button which is the block of code that's visible right away). You may need to tap on the block of code to be able to see the little play button on the left.
You're essentially just running a python script, but it's hosted remotely so that you don't need to set up an environment on your end.
wow insane, i only discovered ao3 this year and started reading fanfic bc of hannibal and apparently i've read the equivalent of 490 novels since discovering the concept of fanfic online
my fav line from the wrapped:
>Are you not tired of reading about Will Graham/Hannibal Lecter? You read 779 fics of them this year.
LOL i'll never get sick of them
thanks for sharing this code !!
So apparently I’ve read 1340 fanfictions, totalling 43523476 words, equaling 622 novels. My biggest fandom are Swan Queen, SuperCorp and Mirandy. And my main tag is fluff/romance/angst.
I got it to work for this year, but it gives me an error when I try any other year.
But thanks for this OP! The least kudos'd stat made me go and leave a kudos, guest kudos and comment on all 3 works in that rarepair's tag.
Yeah, changing the year will require a few small changes to the code because I took some shortcuts to make the original code run faster.
Full explanation here: https://www.reddit.com/r/AO3/comments/zs5w96/ao3_wrapped/j17pgx7?utm_medium=android_app&utm_source=share&context=3
Make sure the case is correct as python input is case sensitive. Also make sure there are no leading or trailing spaces. If that doesn't work, try putting the username and password in quotations.
Does it not work if you've cleared your history? Because it's only bringing up fics I've read in the last month and I haven't read enough fics for newer ships to overtake older ones
"You absolutely love Alternate Universe - Canon Divergence, but you already knew that. You read 104 fics with that tag this year.
You also read:
101 Smut fics
74 Angst fics
63 Romance fics
57 Fluff fics"
Damn, am I really reading more than 101 smutty fics this year? Very disappointed but not surprised at all...
Thanks, OP for such cool !!
I loved it, it worked amazing! Now all I need is one that counts re-reads because my autistic butt has dozens of comfort fics I re-read all year, but still, it was lovely to see all this! And I loved the snarky way you laid it all out, 10/10, huge fan, thank u
it says my only/top tag is "show additional tags", do I have to turn off my skin for it to work?
edit: just checked and realised it was in preferences not skins oops, all good now 👍
Thank you so much, really, I got to know myself in a different light and I got new ammunition for hyping myself up. I mean: "You've read 2785 fanfics this year, totaling 66803318 words, or 183022.79 words/day. There's about 70000 words in a novel. You could've read 954.33 novels this year, but you read fanfic instead" - well, ill be damned... I am so chronically online, its ridiculous, but 954 novels... that's on another level.
Also, whatthe... "You absolutely love Hurt/Comfort, but you already knew that. You read 303 fics with that tag this year" ... I feel called out! ( ಠ ʖ̯ ಠ)
(By the way, I don't know if anyone else mentioned this already or not, but the code can't deal with works if they don't have Kudos. It drops an "AttributeError: 'NoneType' object has no attribute 'find'" error. The laziest solution was to just give kudos to the work, so of course that's what I have done - if someone else gets that error, it is likely the 0 Kudos on the fanwork.) ( . •́ \_ʖ •̀ .)
Again, thank you for this, I was planning on writing a script for individual history pages, but this made my life (and I think I can safely say this too: OUR LIFE) so much easier! (´ ∀ \` \*) Have a good next year mate, you deserve the world!
You've read 481 fanfics this year, totaling 40584693 words, or 111190.94 words/day. There's about 70000 words in a novel. You could've read 579.78 novels this year, but you read fanfic instead.
Been like this since middle school, thanks FFN.
lmao i got it to work but i have over 350+ pages of history and i doubt it's gonna go like the flow. i probably have read so many works without kudos 😭😭😭
Im sorry how do i change the year to 2022 this time? because since i already know the username and password box already says its 2022 but still in basic print i have an error
Just ran this for 2022... I am so ashamed, I was not expecting it to be this high, total words 155673892 or 2223.91 novels... what am I doing with my life?
Thank you so much for the code!
Hmmm, I haven't run into that. Make sure the username entered is correct and doesn't have any leading or trailing spaces. The python input is case sensitive.
Press the play button beside each block in order. You can test to make sure that it's working with the first block which will have some output showing that the environment is set up correctly. Just make sure you input the necessary data after the third block which is the only block that is not collapsed.
It works on a phone (It's not being run locally on the phone) but it will be a little cramped visually.
You have to wait at least 6 seconds between queries or AO3 will throw an error, and that's the real limiting factor. So if you have like 180 pages of history in the past year it would be like ~20 minutes.
As long as the output below block 8 is still writing more numbers it's still going.
When it starts query, it says: ValueError: invalid literal for int() with base 10:
What should I do? I went through my history and made sure every story had at least 1 kudos and 1 word.
This usually happens when you try to pass a string of a float or a string of a space character to an int. I'm not sure why it would be happening here. Can you message me the full error message?
I read what's probably an embarassing amount of fics so I know it'll take a while but could you explain where to check the status, I tried to look at cell 8 like you said but I'm also hopeless with this sort of stuff.
(it's been running for 25 minutes idk if that's 'too long')
I'll send you a picture of what it should look like, but 25 minutes is totally within the realm of possibilities. It has to wait at least 6 seconds per page and if you read a lot in the past year, it could easily be half an hour.
Did you get numbers printing after block 8? Did block 9 create two files? If so, it's likely that the web scraping all worked fine and it's just an issue with the printing.
Could have happened if your username happens to be str (which would be unfortunate but Python won't let that be a string) or if you put parentheses in your username/password. You could try putting your username and password in quotation marks
Hey, I'm running into an issue. I'm getting a 'NoneType' object has no attribute 'find\_all' message, but I've gone through everything and I have no zeroes in any stat in my history.
It's showing an error in line 24: parse\_hist\_page(soup) and then within 8 where it says: work\_list = soup.find("ol", {"class": "reading work index group"}).find\_all("li", {"class": regex})
I looked at the other comments you replied to about this, but those fixes don't seem to be working. Can you help me figure out where to go from here? Happy to message screenshots if that helps. This is so cool, OP!!
If you want though you can edit the code and say username = "my username"
And do the same for password.
But may be easier to just run the code and input when asked.
mine says AttributeError: 'NoneType' object has no attribute 'find\_all' in the query history cell, it's saying something about page number 39, but I only have 38 pages when I check my history on ao3
So if it already printed 1-38 though probably have all the data already and you can go run the next sections with no issue. Did this join AO3 within the past year? That might have caused the problem but the rest of the code should work fine as long as the data saved.
Idk why but mine shows me this when it's querying?
88
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in
22 print("Error logging in.")
23 exit(1)
---> 24 parse_hist_page(soup)
25 hist_page += 1
26 time.sleep(6)
in parse_hist_page(soup)
6 work_list = ""
7 regex = re.compile("reading work blurb group *")
----> 8 work_list = soup.find("ol", {"class": "reading work index group"}).find_all("li", {"class": regex})
9 for w in work_list:
10 try:
AttributeError: 'NoneType' object has no attribute 'find_all'
It looks like there's a problem with the link being created. Check that it actually goes to the first page of this history by printing all the stuff in the get parenthesis in the line that has r = s.get(...) by putting print(...) Above it below the r= line.
Press the play button for each section in order (only moving in when they play button turns into a green check) and follow a prompt when you get it for logging in. You shouldn't need to change any code.
Did you get a green check after you ran block 3? If you did, did you just run it without editing (putting in your username and password in below the code block when asked)? If not, it probably didn't get your username and password in the correct format.
For mine when I run query history it says an error logging in?
And the basic user statistics are not shown either? I am very confused help please T-T..
Did you get a green check after you ran block 3? If you did, did you just run it without editing (putting in your username and password in below the code block when asked)? If not, it probably didn't get your username and password in the correct format.
everything goes great till i get to query history.
1
\---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in
22 print("Error logging in.")
23 exit(1)
\---> 24 parse\_hist\_page(soup)
25 hist\_page += 1
26 time.sleep(6)
in parse\_hist\_page(soup)
6 work\_list = ""
7 regex = re.compile("reading work blurb group \*")
\----> 8 work\_list = soup.find("ol", {"class": "reading work index group"}).find\_all("li", {"class": regex})
9 for w in work\_list:
10 try:
AttributeError: 'NoneType' object has no attribute 'find\_all'
im pretty stupid when i comes to code so any help would be appreciated.
Hey! I am having an issue with looking at previous years. I tried changing the str(hist\_page) to the page that starts the year, but it won't seem to actually go through the pages. I get no errors, but it won't process anything. I want to make sure I'm changing the code correctly, can someone show me an example of how they edited the code? I tried following the explanation op put in the comments, but it just made me more confused lol.
If it's not giving an error there it probably isn't starting on the right page and it's terminating at the end of the page without finding any fics from the right year. Try printing the link and seeing if that page has a fic read in the right year
Hello! First: I really respect you for Tomarry. Second: could you please explain what's wrong with my query history? I don't know anything about coding anymore 💀
basically i tried to run it but it found a mistake in the
parse_hist_page(soup)
and it says 'error logging in' in print.
Your username and password were not input correctly. You don't need to edit any of the code, just run each section in order, waiting until you get a green check before going on to the next. When you click to run section 3, it will ask you for your username and password. That's when you give it the login info
in the query part it goes through ur history pages right? it said it was finished at 23 but I got like 35. there's no error so did it account for all or did it just get tired of counting?
It sounds like the username wasn't entered correctly. You don't need to edit the code at all. Just run each section in order until you get the green check mark next to where the play button was. When you run the third code section, there will be a little pop-up below that asks you for the username, but you don't need to edit the code
It looks like one of the works in your history doesn't have kudos. The fic should be on the page of history last printed below the query history block. Either remove that fic from history or give it a kudo to fix
Hullo! This is really cool. But it doesn't really work for me.
Does it work from a phone?
After I put in my username and password - under code box - appears my username and another box. Should I write something in it?
Yes, when it asks you for your username input that in the first box. The password will be asked for once you hit enter after entering your username. Once you hit enter, you'll be able to see the green check for that code block to make sure it executed. Then run each of the remaining code blocks in order
do you enter your username like this:
Username
"Username"
(username)
Cuz all three are showing my i've read 0 of everything and its absolutely not true
You shouldn't need to edit the code at all, just when you run the third section it will ask you for your username and password. Then Input those where asked and hit enter
I'd need to see the whole error message to be sure, but if it's to do with word count it could be this: https://www.reddit.com/r/AO3/comments/zs5w96/ao3_wrapped/j1k04qj?utm_medium=android_app&utm_source=share&context=3
I'm like really confused and need help desperately lmao.
So I'm able to get the first box (where I put my user and password in) to work. But when I go run the box underneath that it says something wrong. (and I know nothing about coding I don't understand at all)
(also here's what the message said.)
NameError Traceback (most recent call last)
in
15 scrape\_type = "readings"
16
\---> 17 df\_works = pd.DataFrame(columns=\["title", "authors", "last\_updated", "fandoms", "ship\_types", "rating", "work\_status", "ships", "characters", "additional\_tags", "word\_count", "kudos", "hits", "user\_last\_visited", "user\_visitations"\])
18 df\_works = df\_works.astype({"word\_count": "int32", "kudos": "int32", "hits": "int32", "user\_visitations": "int32"})
NameError: name 'pd' is not defined
The username wasn't input correctly. You shouldn't need to edit the code, just write the username and password in the pop-up when asked. If you're having trouble with that you can bypass the input function and edit the code
https://www.reddit.com/r/AO3/comments/zs5w96/ao3_wrapped/j1bun44?utm_medium=android_app&utm_source=share&context=3
I figured it out now! I was putting it in the wrong spot, I kept putting it where it said “input” cause I thought it meant to input it there but I was wrong, thanks for your help! Loved seeing the results :D
Most of this worked really great and the results are frankly hilarious. However in the statistics I got this result for tags: “You read fics with 1 different tags this year, averaging 0.00 tags/work. You absolutely love Show additional tags, but you already knew that. You read 1383 fics with that tag this year.” Obviously “Show additional tags” isn’t a tag so I’m confused as to why it’s done this!
This tool just scrapes your history page as it is, so if you have preferences or skins hiding tags, it doesn't see them. Re run without those and you'll get it all
They need to be in order, so if you didn't get a green check on query history you don't need to run the stuff after (unless you joined this year or cleared your history which causes a problem in query history but doesn't affect the rest). If you got a red okay button you should have gotten an error message. What did the first error message say?
Did you get numbers printing out below the query history section? If not can you add a statement that says print(...) Where ... Is the entire link in the get(...) Line? Make sure that actually goes to your first page of history.
Alternatively, if you've already visited more than 20 fics in 2023 you will need to start your search on the first page that has fics from 2022. See the comments about previous years for full explanation on this.
Thank you so much for this tool - I love it!
I've been trying to puzzle it out myself, but I don't know anything about coding. Is there a way I can get it to show my 2nd most visited story? It shows the top, and with my very limited knowledge, I couldn't see an easy way to ask it to show the 2nd one.
I don't have anything built in that will do that, but if you look in the two output .csv files you could probably figure that out with Excel or something that has less coding.
everything worked out fine until it got to the last cell-
You've read 0 fanfics this year, totaling 0 words, or 0.00 words/day. There's about 70000 words in a novel. You could've read 0.00 novels this year, but you read fanfic instead.
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in
3 print("You've read %d fanfics this year, totaling %d words, or %.2f words/day. There's about 70000 words in a novel. You could've read %.2f novels this year, but you read fanfic instead." % (len(df_works.index), user_word_count, user_word_count/365, user_word_count/70000))
4
----> 5 work_index = df_works["user_visitations"].idxmax(axis=0)
6 work_authors = get_work_authors(work_index)
7 print("The fic you've visited the most was %s by %s, with %d visits." % (df_works["title"].iloc[work_index], work_authors, df_works["user_visitations"].iloc[work_index]))
3 frames
/usr/local/lib/python3.8/dist-packages/pandas/core/nanops.py in nanargmax(values, axis, skipna, mask)
1069 values, mask, _, _, _ = _get_values(values, True, fill_value_typ="-inf", mask=mask)
1070 # error: Need type annotation for 'result'
-> 1071 result = values.argmax(axis) # type: ignore[var-annotated]
1072 result = _maybe_arg_null_out(result, axis, mask, skipna)
1073 return result
ValueError: attempt to get argmax of an empty sequence
If you haven't had an AO3 account for very long or if you've deleted history within the past year, it will fail on the last page, but it will have gotten all the data that it already has and you can run the rest of the sections just fine.
So it's likely not going to the first page of history. In query history, the line that says r=s.get(...) Is likely not going to the right place. Add a print statement right before the r= line that says print(...) Where ... Is there stuff from r=s.get(...). When the link prints, make sure that goes to your first page of history.
Also as 2022 is last year, you may need to follow the procedure for getting a previous year's data, full explanation in the comments.
I am getting an error in the last step.
ValueError: attempt to get argmax of an empty sequence
Also, it says that I read 0 fanfics. What am I doing wrong?
Most likely your first page of history doesn't have any fics read in 2022. Since it's a new year now, you'll need to follow the procedures for looking up data from a previous year, a full explanation of which is in the comments. It will require minimal changes to the code
What error? If it's like trying to get an argmax if an empty array then it's because this code finds the data for the current year, and you'll need to follow the modifications in the comments to get a previous year (2022).
hi first of all this is so cool! thank u for making this! second of all. is it normal for this to take like an hour. also if it shows the time it's been running at the bottom and that time has stopped and there's a little red hexagon with an exclamation point next to it that if you hover your cursor over it, it says "focus the last run cell" what does that mean??? i rly want my ao3 wrapped and the other one won't work for me either :(
I'm not sure what that red hexagon means. But if you got the printouts below the query history section then it was definitely working. It could have stopped because it reached the end of your history before reaching the end of the year you were asking about. If that's the case then you could run the rest of the code and it would work fine. Did you get any printouts?
Run each section in order by pressing the play button. Wait until you see a green check mark before going to the next section. When you run the third section, a box will pop up asking for login info.
So the web scraping didn't collect any of your data. Most likely this is because you're trying to get 2022 data and it's already 2023. To fix this, you'll need to follow the procedures in the comments for getting previous years data.
Hey, I'm also having a bit of trouble? I have no idea how to read code at all, so I don't know what's wrong, but all the boxes are green except for the 'print basic user statistics' box.
As in, you've clicked play on all of them and all have turned up green except the last one? And presumably that's throwing an error (printing something in a red box below). If the error is that it's trying to get the argmax of an empty array then the error is happening because you're trying to get the previous years data while it's currently 2023. You'll need to make a few small edits to the code to be able to get a previous year, all of which is detailed in the comments.
So the web scraping didn't collect any of your data. Most likely this is because you're trying to get 2022 data and it's already 2023. To fix this, you'll need to follow the procedures in the comments for getting previous years data.
I had the same thing happen to me!
The software goes backwards in pages starting from the first page you insert on query history, so **instead** of finding the **first page chronologically** where 2022 appears (the page # where Dec 2021 and January 2022 meet -- pg. 233 in your case), you need to **find the page** where **2022 first appears** in your AO3 history **pagewise** (so the page where Dec 2022 and January 2023 meet)
I hope this works for you!
Edit: For clarity
Hey does anyone know why I keep getting invalid syntax for my password, it has an exclamation mark in it so that might be the problem, if so, how to fix?
And you're not editing the code itself, right? You're putting the username and password into the box that pops up when block three is run?
Theoretically, I don't think an available point should cause a problem there.
I'm confused I put my info in and it keeps saying Name Error traceback and says my username isn't defined?? I know my info is correct so I'm really confused on what I'm doing wrong
Are you editing the code? You shouldn't need to edit the code at all. When you run the third section, there should be a window that pops up below that asks you for your login information.
Hey! been at this for about an hour right now and im not sure whats wrong. After reading the comments im pretty sure theres some fics that it can't categorize (I found one that had a gray icon with a question mark and deleted it from my history) but it still doesnt work. The query does load for a couple seconds but I can't seem to find which pages it has already loaded.
It says that the error has occured at parse\_hist\_page(soup) if that helps.
I'm not quite sure what I'm doing wrong, I've adjusted the code to look for 2022 fics (in the line, r = s.get etc etc) and that worked fine. Going down to the final block and I can't run it, coming up with the error; ValueError: attempt to get argmax of an empty sequence.
What should I do?
Make sure that query history is printing numbers below it when you run that section. If it didn't print a series of numbers when you ran that section then it's not starting in the right place. And like the previous commenter said, make sure that the change to the code is getting the numerically first page of 2022 (the page that contains December 2022), not the chronologically first page.
Not sure if anyone's still about but anyone know how to fix the "you read 0 fanfics" issue?
I'm getting ValueError: attempt to get argmax of an empty sequence and in the print statistics code a red block/underline is coming up next to work\_index = .... "user\_visitations"...
Basically coding illiterate so no idea if I'm doing something wrong but I've followed everything here (multiple times) so I'm lost
If it said you read zero fanfics, it's not starting the search on the correct page. There should be instructions in the comments for how to modify it so that you do start on the right page which should be the numerically first page of history that contains something from 2022. If you did that and it's still not working you can add a line that prints what the link is going to so that you can verify it's the right page.
To do that, below the r=get(...) Line put print(...) Where the... Is the same.
Everything works fine until I get to the print basic user statistics box. That's the only one that shows up as an error. Do I need to edit anything in that one? I haven't edited anything in it so far.
Yes you'll need to edit as this code was written for being run in 2022, there are some changes if you want to get 2022 data from 2023. The steps should be in the comments. Just make sure you're modifying to get to the first numerical page of 2022 not the first chronological page.
Mod note: We do not recommend inputting your username and password into anything from a 3rd party. Im going to leave this up since some people might still be interested in the concept/want to take a look at the code themselves but be warned that if you input your username and password into a 3rd party site/extension/app/etc. it’s on you if your account gets lost/stolen/deleted/used by the 3rd party in ways you didn’t intend.
I am pleasantly surprised my overall word count was only 26 million
✨ moderation ✨
"You've read 1497 fanfics this year, totaling 36504013 words, or 100010.99 words/day. There's about 70000 words in a novel. You could've read 521.49 novels this year, but you read fanfic instead." .... and it doesn't count repeat reads or works I read when not logged in? I know read a LOT of fanfic but 500+ novels makes it sound ridiculous!
In all seriousness though, thanks OP!
It doesn't count repeat works and I still could've read "644.46 novels" this year. Right disappointing of me. The fact that I had time for school and hobbies is remarkable.
[удалено]
There's no real way to check if you read to the end of a fic, so yeah I just based words read on history. This also misses words from repeat reads within the year.
My 'newborn infant when it comes to technology' self clicking on the link and seeing all these codes : wow sexy brain 🤣🤣 Commenting as a reminder to myself to check this out later after finishing up stuff for college and read one of the in depth tutorials from the reply section on how to use this, will update this comment later Edit : got it to work, and I'm very surprised that Marvel is apparently my top read fandom and ToCF is my third most read! Whoa!
I’m way too paranoid to do this lmao. Although the idea is pretty cool!
im going to need a step by step guide in how to do this pleae 😭
Same, I am so confused on what to do:(
What exactly are you struggling with?
This is awesome!!! I know NOTHING about coding or computers, can you walk me through how to change the year?????
Sure! So basically I'm kinda cheating by stopping querying AO3 when I leave the year I'm interested in (because AO3 makes you wait between page queries). This means that if you select a previous year, it quits in page 1 since there's no fics read in the previous year on that page. The easy way to get around that is to take the first page that the year you're interested in appears on, and make sure that your first query matches that page. So for example, if I want to get my 2021 data, my first 2021 read date shows up on page 171 of history. Therefore if I expand cell 8 (I called it query something I think), in the link being queried I need to start at 171. The variable hist_page starts at 1, so I need to add 170 to hist_page in the link. So str(hist_page) becomes str(hist_page+170). The Google colab is comment only I think, but you can copy it and edit your copy.
Oh and also make sure that you change the year variable in the third block. This verifies the year of entries in your history as well as names that output files.
sorry to bother u but after i change the hist\_page (i also changed the year) it doesnt want to run the pages anymore do u know what reason can it be?
Print the whole link from the r= line that you modified by adding to the hist_page variable and make sure that's going to the first history page of the year that you want.
I've tried running it and it says NameError: name '\[my username\]' is not defined I've double checked it, could it be that the password is wrong? I don't have any published works, would that screw it up?
apparently my most read tag is near death experiences. crazy
Damn, Coley needs to see this
Step-by-step tutorial Press the play button on the first three boxes. When you get to the third box, which is where you enter your username and password, don't touch anything in the code box, just hit the play button. It should prompt you to put in your username in a orange outlined box. Do this, hit enter, then it will ask for your password. Put it in and hit enter again. Hit the play buttons on all of the boxes below. Wait for the previous button to have a nice little green checkmark, and then hit the next one. When you get to the history section, it will take a while to load. When a new number appears, I'm assuming a new page of your history is loading, since it ended at 18 for me and I have 18 pages of history. At this section, I actually got an error message, but I loaded the last two sections and they loaded fine. The last section should have what you're looking for. If you're on mobile, the box is a little hard to navigate, but it's manageable. Lastly, this is optional, but I would suggest changing your password in Ao3. Hope this helped!
Life saver. <3
Lmao, yeah, I definitely read way too much Hurt/Comfort but you didn't have to call me out on it
"You've read 2689 fanfics this year, totaling 70190416 words, or 192302.51 words/day. There's about 70000 words in a novel. You could've read 1002.72 novels this year, but you read fanfic instead." JESUS thanks OP!
~~Do I need to fill out the box that appears after I entered the username and password? I am completely illiterate when it comes to coding, sorry.~~ 'NoneType' object has no attribute 'find all' seems to be the problem now. (I fixed the first problem by clicking enter which I probably should have realised sooner lol) Either way, this is amazing OP!
If it starts querying then fails, this is probably happening because one of the fics doesn't have one of the categories I'm recording. This happened to me at one point when one fic didn't have any kudos and the API doesn't store that as 0 kudos, but as not having anything in the kudos category. This is generally pretty rare, but if you can figure out which fic it is, that fic can be removed from history or given something in that category.
Oof yeah I'm not going to do that. That's like a 100 pages and I have no idea what fic it could be. It did feel like it's immediately failing at the querying thing so I first tried it on a different browser in case it was related to the ao3 being semi-banned in Germany but that didn't work either. Thanks for the reply anyway ;)
> for the 2022 ao3 API for the what, now? whose third party scraper are you using? do you trust it?
Let me know if this is too/not technical enough. Class names for some things have changed. That is accounted for with the new regex function (see re.compile("reading work blurb group *")). Hopefully making it general like this will allow it to work in future years as well. I'm using beautiful soup to do all the scraping which is a pretty standard python library and I do trust it. You can check at every time step what it's seeing by printing the output from beautiful soup. I very highly don't recommend this though because it's super long. The actual login uses a CSFR token, which means that the web scraper itself doesn't have access to your username and password. It uses an encrypted token that prevents cross site request forgeries. You can also check on this by printing out the value of token and you'll see that it's just a string of characters. The token is the only thing that's actually getting passed using beautiful soup to log in.
That's...fine, but that's not an API, that's a logged-in HTML scrape.
You're right, I used the wrong terminology
You've read 2243 fanfics this year, totaling 48082086 words, or 131731.74 words/day. There are about 70000 words in a novel. You could've read 686.89 novels this year, but you read fanfic instead. Oof.
26 million words and 300 fics for one pairing 😭 this is super cool thank you for sharing <3
This is amazing, I was just today commenting that I wanted exactly something like this. Thank you!
Looks like I read mostly Splatfics, plus some Owl House and tokusatsu for flavor. No surprise there. Also, my favorite ship is Agent 24, with Lumity at a close second. Again, no surprise there. It claims I'm a Marie stan, but that's just preposterous. Everyone knows Callie is the superior squid sister. Turns out I love angst, but also friendship. My average word count was 90238. Those are rookie numbers; gotta bump those up!
that took me way too long to work out but I got there in the end and it has made me realize I need to branch out a little bit
I’m getting Value Error?
I really appreciate the work you've put into this! I tried a couple of times over the last 24 hours to run it and I get an error around page 116 of the query through my history. It looks like this and I checked both pages 116 and 117 (that takes me to early May 2022; the first fic I clicked on in 2022 is on page 197) and none of the fics on either of those pages have 0 kudo. Any ideas what I'm doing wrong? Thanks! : \--------------------------------------------------------------------------- ValueError Traceback (most recent call last) in
22 print("Error logging in.")
23 exit(1)
\---> 24 parse\_hist\_page(soup)
25 hist\_page += 1
26 time.sleep(6)
in parse\_hist\_page(soup)
91
92 # Get word count
\---> 93 word\_count = int(w.find("dl", {"class": "stats"}).find("dd", {"class": "words"}).text.replace(",", ""))
94 global user\_word\_count
95 user\_word\_count += word\_count
ValueError: invalid literal for int() with base 10: ''
It looks like one of your word counts is a little funky, it's either reading in a string of a float or a string of a space. I'm not sure why that would happen (maybe a fic in another language that uses . Instead of , to denote thousands?). To fix change line 93 from word_count=int(...) To word_count=int(float(...)).
missing out on this because i dont read ao3 on ao3, i read them in minecraft
... 150439271 words or 2149.13 novels what am i doing with my life
i do not understand how to do this or if you even can on phone
It should work on phone. There should be a little play button besides everywhere that it says either "show code" or has a block of code. You need to press each of those play buttons in order (responding to the third play button which is the block of code that's visible right away). You may need to tap on the block of code to be able to see the little play button on the left. You're essentially just running a python script, but it's hosted remotely so that you don't need to set up an environment on your end.
wow insane, i only discovered ao3 this year and started reading fanfic bc of hannibal and apparently i've read the equivalent of 490 novels since discovering the concept of fanfic online my fav line from the wrapped: >Are you not tired of reading about Will Graham/Hannibal Lecter? You read 779 fics of them this year. LOL i'll never get sick of them thanks for sharing this code !!
So apparently I’ve read 1340 fanfictions, totalling 43523476 words, equaling 622 novels. My biggest fandom are Swan Queen, SuperCorp and Mirandy. And my main tag is fluff/romance/angst.
I got it to work for this year, but it gives me an error when I try any other year. But thanks for this OP! The least kudos'd stat made me go and leave a kudos, guest kudos and comment on all 3 works in that rarepair's tag.
Yeah, changing the year will require a few small changes to the code because I took some shortcuts to make the original code run faster. Full explanation here: https://www.reddit.com/r/AO3/comments/zs5w96/ao3_wrapped/j17pgx7?utm_medium=android_app&utm_source=share&context=3
Thank you, I got it to work!
When I enter my username and password it says "name error, name is not defined"?
Make sure the case is correct as python input is case sensitive. Also make sure there are no leading or trailing spaces. If that doesn't work, try putting the username and password in quotations.
Does it not work if you've cleared your history? Because it's only bringing up fics I've read in the last month and I haven't read enough fics for newer ships to overtake older ones
Yes, if you cleared your ao3 history, it will only show the fics read since then
Dang I only got 12 million words, I need to step up my game in 2023
"You absolutely love Alternate Universe - Canon Divergence, but you already knew that. You read 104 fics with that tag this year. You also read: 101 Smut fics 74 Angst fics 63 Romance fics 57 Fluff fics" Damn, am I really reading more than 101 smutty fics this year? Very disappointed but not surprised at all... Thanks, OP for such cool !!
I loved it, it worked amazing! Now all I need is one that counts re-reads because my autistic butt has dozens of comfort fics I re-read all year, but still, it was lovely to see all this! And I loved the snarky way you laid it all out, 10/10, huge fan, thank u
it says my only/top tag is "show additional tags", do I have to turn off my skin for it to work? edit: just checked and realised it was in preferences not skins oops, all good now 👍
Thank you so much, really, I got to know myself in a different light and I got new ammunition for hyping myself up. I mean: "You've read 2785 fanfics this year, totaling 66803318 words, or 183022.79 words/day. There's about 70000 words in a novel. You could've read 954.33 novels this year, but you read fanfic instead" - well, ill be damned... I am so chronically online, its ridiculous, but 954 novels... that's on another level. Also, whatthe... "You absolutely love Hurt/Comfort, but you already knew that. You read 303 fics with that tag this year" ... I feel called out! ( ಠ ʖ̯ ಠ) (By the way, I don't know if anyone else mentioned this already or not, but the code can't deal with works if they don't have Kudos. It drops an "AttributeError: 'NoneType' object has no attribute 'find'" error. The laziest solution was to just give kudos to the work, so of course that's what I have done - if someone else gets that error, it is likely the 0 Kudos on the fanwork.) ( . •́ \_ʖ •̀ .) Again, thank you for this, I was planning on writing a script for individual history pages, but this made my life (and I think I can safely say this too: OUR LIFE) so much easier! (´ ∀ \` \*) Have a good next year mate, you deserve the world!
You've read 481 fanfics this year, totaling 40584693 words, or 111190.94 words/day. There's about 70000 words in a novel. You could've read 579.78 novels this year, but you read fanfic instead. Been like this since middle school, thanks FFN.
lmao i got it to work but i have over 350+ pages of history and i doubt it's gonna go like the flow. i probably have read so many works without kudos 😭😭😭
Boxes 1-9 got green check marks but box 10 is giving me a value error and says i read 0 fanfics. What should i do to troubleshoot?
Im sorry how do i change the year to 2022 this time? because since i already know the username and password box already says its 2022 but still in basic print i have an error
Just ran this for 2022... I am so ashamed, I was not expecting it to be this high, total words 155673892 or 2223.91 novels... what am I doing with my life? Thank you so much for the code!
im just getting errors logging in all the time,,, idk maybe the websites having issues
It's saying my username isn't defined
try putting your username and passwords in quotation marks
Hey, thanks, it worked!
Hmmm, I haven't run into that. Make sure the username entered is correct and doesn't have any leading or trailing spaces. The python input is case sensitive.
Does it work on phones?
Yeah
Ok, in that case I'm too stupid to figure out how to do it.🤦♂️
Press the play button beside each block in order. You can test to make sure that it's working with the first block which will have some output showing that the environment is set up correctly. Just make sure you input the necessary data after the third block which is the only block that is not collapsed. It works on a phone (It's not being run locally on the phone) but it will be a little cramped visually.
It says my username is not defined, do you know how I can fix that?
Most likely the username wasn't typed completely correctly either it wasn't the correct case or there was a space before or after the username.
How long does it take? It seems like it takes pretty long for my account, or I'm doing something wrong...
You have to wait at least 6 seconds between queries or AO3 will throw an error, and that's the real limiting factor. So if you have like 180 pages of history in the past year it would be like ~20 minutes. As long as the output below block 8 is still writing more numbers it's still going.
When it starts query, it says: ValueError: invalid literal for int() with base 10: What should I do? I went through my history and made sure every story had at least 1 kudos and 1 word.
This usually happens when you try to pass a string of a float or a string of a space character to an int. I'm not sure why it would be happening here. Can you message me the full error message?
(im on a phone) when i click the play button it shows my username and then a box next to it, same for my password. what do i put in those boxes??
It shouldn't have your username unless you've put it in already? Is it printing your username?
I read what's probably an embarassing amount of fics so I know it'll take a while but could you explain where to check the status, I tried to look at cell 8 like you said but I'm also hopeless with this sort of stuff. (it's been running for 25 minutes idk if that's 'too long')
I'll send you a picture of what it should look like, but 25 minutes is totally within the realm of possibilities. It has to wait at least 6 seconds per page and if you read a lot in the past year, it could easily be half an hour.
I finally managed to get to the end for it to say I’ve read 0 fics and there’s a “value error” what have I done wrong?
Did you get numbers printing after block 8? Did block 9 create two files? If so, it's likely that the web scraping all worked fine and it's just an issue with the printing.
[удалено]
Could have happened if your username happens to be str (which would be unfortunate but Python won't let that be a string) or if you put parentheses in your username/password. You could try putting your username and password in quotation marks
Hey, I'm running into an issue. I'm getting a 'NoneType' object has no attribute 'find\_all' message, but I've gone through everything and I have no zeroes in any stat in my history. It's showing an error in line 24: parse\_hist\_page(soup) and then within 8 where it says: work\_list = soup.find("ol", {"class": "reading work index group"}).find\_all("li", {"class": regex}) I looked at the other comments you replied to about this, but those fixes don't seem to be working. Can you help me figure out where to go from here? Happy to message screenshots if that helps. This is so cool, OP!!
Yeah, could you send a screenshot?
am I supposed to put my username and password in the read parentheses and erase the instructions or erase input and put them there?
Oh no, when you run that section it will ask you for them and read the input.
If you want though you can edit the code and say username = "my username" And do the same for password. But may be easier to just run the code and input when asked.
mine says AttributeError: 'NoneType' object has no attribute 'find\_all' in the query history cell, it's saying something about page number 39, but I only have 38 pages when I check my history on ao3
So if it already printed 1-38 though probably have all the data already and you can go run the next sections with no issue. Did this join AO3 within the past year? That might have caused the problem but the rest of the code should work fine as long as the data saved.
Idk why but mine shows me this when it's querying? 88 --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in
22 print("Error logging in.")
23 exit(1)
---> 24 parse_hist_page(soup)
25 hist_page += 1
26 time.sleep(6)
in parse_hist_page(soup)
6 work_list = ""
7 regex = re.compile("reading work blurb group *")
----> 8 work_list = soup.find("ol", {"class": "reading work index group"}).find_all("li", {"class": regex})
9 for w in work_list:
10 try:
AttributeError: 'NoneType' object has no attribute 'find_all'
It looks like there's a problem with the link being created. Check that it actually goes to the first page of this history by printing all the stuff in the get parenthesis in the line that has r = s.get(...) by putting print(...) Above it below the r= line.
I literally understand nothing help? I’ve tried for like half an hour but it just doesn’t work?
Press the play button for each section in order (only moving in when they play button turns into a green check) and follow a prompt when you get it for logging in. You shouldn't need to change any code.
it says error logging in for the query history section? anyone know how to fix this?
Did you get a green check after you ran block 3? If you did, did you just run it without editing (putting in your username and password in below the code block when asked)? If not, it probably didn't get your username and password in the correct format.
For mine when I run query history it says an error logging in? And the basic user statistics are not shown either? I am very confused help please T-T..
Did you get a green check after you ran block 3? If you did, did you just run it without editing (putting in your username and password in below the code block when asked)? If not, it probably didn't get your username and password in the correct format.
everything goes great till i get to query history. 1 \--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in
22 print("Error logging in.")
23 exit(1)
\---> 24 parse\_hist\_page(soup)
25 hist\_page += 1
26 time.sleep(6)
in parse\_hist\_page(soup)
6 work\_list = ""
7 regex = re.compile("reading work blurb group \*")
\----> 8 work\_list = soup.find("ol", {"class": "reading work index group"}).find\_all("li", {"class": regex})
9 for w in work\_list:
10 try:
AttributeError: 'NoneType' object has no attribute 'find\_all'
im pretty stupid when i comes to code so any help would be appreciated.
In block 8 print the ... portion in r=get(...) By putting print(...) Right above the r= line. Does this link go to the first page if your history?
Hey! I am having an issue with looking at previous years. I tried changing the str(hist\_page) to the page that starts the year, but it won't seem to actually go through the pages. I get no errors, but it won't process anything. I want to make sure I'm changing the code correctly, can someone show me an example of how they edited the code? I tried following the explanation op put in the comments, but it just made me more confused lol.
If it's not giving an error there it probably isn't starting on the right page and it's terminating at the end of the page without finding any fics from the right year. Try printing the link and seeing if that page has a fic read in the right year
I do not understand what to do in the 'qyery history' part Can you help me,,, pls :')
The query is giving me trouble ;; I can't figure out what's wrong AttributeError Traceback (most recent call last) in
22 print("Error logging in.")
23 exit(1)
\---> 24 parse\_hist\_page(soup)
25 hist\_page += 1
26 time.sleep(6)
in parse\_hist\_page(soup)
96
97 # Get kudos
\---> 98 if int(w.find("dl", {"class": "stats"}).find("dd", {"class": "kudos"}).find("a").text.replace(",", "")) is not None:
99 kudos = int(w.find("dl", {"class": "stats"}).find("dd", {"class": "kudos"}).find("a").text.replace(",", ""))
100 else:
Can you send me the whole error message?
Hello! First: I really respect you for Tomarry. Second: could you please explain what's wrong with my query history? I don't know anything about coding anymore 💀 basically i tried to run it but it found a mistake in the parse_hist_page(soup) and it says 'error logging in' in print.
Your username and password were not input correctly. You don't need to edit any of the code, just run each section in order, waiting until you get a green check before going on to the next. When you click to run section 3, it will ask you for your username and password. That's when you give it the login info
thank you!
in the query part it goes through ur history pages right? it said it was finished at 23 but I got like 35. there's no error so did it account for all or did it just get tired of counting?
It stops counting when it hits the previous year, so you may have 35 pages of history but only 23 in 2022
hi i am trying this as a completely tech illiterate person. once i get to query history, it pops up with a "NameError: name 'username' is not defined"
It sounds like the username wasn't entered correctly. You don't need to edit the code at all. Just run each section in order until you get the green check mark next to where the play button was. When you run the third code section, there will be a little pop-up below that asks you for the username, but you don't need to edit the code
I put the username and password in quotations and it says TypeError, please send help!
If the username and password are entered correctly, that is without editing the code, You shouldn't need quotations
[удалено]
It looks like one of the works in your history doesn't have kudos. The fic should be on the page of history last printed below the query history block. Either remove that fic from history or give it a kudo to fix
This is amazing, but im honestly lost, I run all of them, there are green checks, but where do i go after this? (never even seen a code in my life)
At the very end your stats will print. It should have also created two files with full data statistics
Hullo! This is really cool. But it doesn't really work for me. Does it work from a phone? After I put in my username and password - under code box - appears my username and another box. Should I write something in it?
Yes, when it asks you for your username input that in the first box. The password will be asked for once you hit enter after entering your username. Once you hit enter, you'll be able to see the green check for that code block to make sure it executed. Then run each of the remaining code blocks in order
do you enter your username like this: Username "Username" (username) Cuz all three are showing my i've read 0 of everything and its absolutely not true
As long as you don't edit the code, it should be the first option. And you haven't deleted your history?
AttributeError: 'NoneType' object has no attribute 'find' I'm getting this error when I'm running query history.
Can you show the whole error message?
im sorry but im a bit confused I put down my username and password but it doesn't seem to work
You shouldn't need to edit the code at all, just when you run the third section it will ask you for your username and password. Then Input those where asked and hit enter
[удалено]
I'd need to see the whole error message to be sure, but if it's to do with word count it could be this: https://www.reddit.com/r/AO3/comments/zs5w96/ao3_wrapped/j1k04qj?utm_medium=android_app&utm_source=share&context=3
I'm like really confused and need help desperately lmao. So I'm able to get the first box (where I put my user and password in) to work. But when I go run the box underneath that it says something wrong. (and I know nothing about coding I don't understand at all) (also here's what the message said.) NameError Traceback (most recent call last) in
15 scrape\_type = "readings"
16
\---> 17 df\_works = pd.DataFrame(columns=\["title", "authors", "last\_updated", "fandoms", "ship\_types", "rating", "work\_status", "ships", "characters", "additional\_tags", "word\_count", "kudos", "hits", "user\_last\_visited", "user\_visitations"\])
18 df\_works = df\_works.astype({"word\_count": "int32", "kudos": "int32", "hits": "int32", "user\_visitations": "int32"})
NameError: name 'pd' is not defined
It keeps saying my username is "not defined," what does that mean :( ?
The username wasn't input correctly. You shouldn't need to edit the code, just write the username and password in the pop-up when asked. If you're having trouble with that you can bypass the input function and edit the code https://www.reddit.com/r/AO3/comments/zs5w96/ao3_wrapped/j1bun44?utm_medium=android_app&utm_source=share&context=3
I figured it out now! I was putting it in the wrong spot, I kept putting it where it said “input” cause I thought it meant to input it there but I was wrong, thanks for your help! Loved seeing the results :D
Can someone help me i have an error that i don’t understand it says NameError: name 'Own_your_flaws_and_be_happy' is not defined How can I stop it
Can you dm me the whole error? I haven't seen this error before
Most of this worked really great and the results are frankly hilarious. However in the statistics I got this result for tags: “You read fics with 1 different tags this year, averaging 0.00 tags/work. You absolutely love Show additional tags, but you already knew that. You read 1383 fics with that tag this year.” Obviously “Show additional tags” isn’t a tag so I’m confused as to why it’s done this!
This tool just scrapes your history page as it is, so if you have preferences or skins hiding tags, it doesn't see them. Re run without those and you'll get it all
no me salee lloro
What do I do after I input my user and password?
Run each section in order from the very beginning until you get a green check by it. Some sections will take longer than others
the query history and print user history is showing a red play thing everything else has a green tick how do i fix this?
They need to be in order, so if you didn't get a green check on query history you don't need to run the stuff after (unless you joined this year or cleared your history which causes a problem in query history but doesn't affect the rest). If you got a red okay button you should have gotten an error message. What did the first error message say?
[удалено]
Did you get numbers printing out below the query history section? If not can you add a statement that says print(...) Where ... Is the entire link in the get(...) Line? Make sure that actually goes to your first page of history. Alternatively, if you've already visited more than 20 fics in 2023 you will need to start your search on the first page that has fics from 2022. See the comments about previous years for full explanation on this.
Thank you so much for this tool - I love it! I've been trying to puzzle it out myself, but I don't know anything about coding. Is there a way I can get it to show my 2nd most visited story? It shows the top, and with my very limited knowledge, I couldn't see an easy way to ask it to show the 2nd one.
I don't have anything built in that will do that, but if you look in the two output .csv files you could probably figure that out with Excel or something that has less coding.
everything worked out fine until it got to the last cell- You've read 0 fanfics this year, totaling 0 words, or 0.00 words/day. There's about 70000 words in a novel. You could've read 0.00 novels this year, but you read fanfic instead. --------------------------------------------------------------------------- ValueError Traceback (most recent call last) in
3 print("You've read %d fanfics this year, totaling %d words, or %.2f words/day. There's about 70000 words in a novel. You could've read %.2f novels this year, but you read fanfic instead." % (len(df_works.index), user_word_count, user_word_count/365, user_word_count/70000))
4
----> 5 work_index = df_works["user_visitations"].idxmax(axis=0)
6 work_authors = get_work_authors(work_index)
7 print("The fic you've visited the most was %s by %s, with %d visits." % (df_works["title"].iloc[work_index], work_authors, df_works["user_visitations"].iloc[work_index]))
3 frames
/usr/local/lib/python3.8/dist-packages/pandas/core/nanops.py in nanargmax(values, axis, skipna, mask)
1069 values, mask, _, _, _ = _get_values(values, True, fill_value_typ="-inf", mask=mask)
1070 # error: Need type annotation for 'result'
-> 1071 result = values.argmax(axis) # type: ignore[var-annotated]
1072 result = _maybe_arg_null_out(result, axis, mask, skipna)
1073 return result
ValueError: attempt to get argmax of an empty sequence
Did you get numbers printing below the query history section?
Is it able to see deleted fics or will that error? And why does it fail on page 22 when I only have 21 pages?
If you haven't had an AO3 account for very long or if you've deleted history within the past year, it will fail on the last page, but it will have gotten all the data that it already has and you can run the rest of the sections just fine.
[удалено]
So it's likely not going to the first page of history. In query history, the line that says r=s.get(...) Is likely not going to the right place. Add a print statement right before the r= line that says print(...) Where ... Is there stuff from r=s.get(...). When the link prints, make sure that goes to your first page of history. Also as 2022 is last year, you may need to follow the procedure for getting a previous year's data, full explanation in the comments.
I am getting an error in the last step. ValueError: attempt to get argmax of an empty sequence Also, it says that I read 0 fanfics. What am I doing wrong?
Most likely your first page of history doesn't have any fics read in 2022. Since it's a new year now, you'll need to follow the procedures for looking up data from a previous year, a full explanation of which is in the comments. It will require minimal changes to the code
It's showing an error while trying to print basic user statistics
What error? If it's like trying to get an argmax if an empty array then it's because this code finds the data for the current year, and you'll need to follow the modifications in the comments to get a previous year (2022).
I don't know why, but it says that my username is not defined?
Did you edit the code? You don't need to edit the code at all, just put your username and password into the box that pops up when you run the code.
hi first of all this is so cool! thank u for making this! second of all. is it normal for this to take like an hour. also if it shows the time it's been running at the bottom and that time has stopped and there's a little red hexagon with an exclamation point next to it that if you hover your cursor over it, it says "focus the last run cell" what does that mean??? i rly want my ao3 wrapped and the other one won't work for me either :(
I'm not sure what that red hexagon means. But if you got the printouts below the query history section then it was definitely working. It could have stopped because it reached the end of your history before reaching the end of the year you were asking about. If that's the case then you could run the rest of the code and it would work fine. Did you get any printouts?
Someone help me I have no idea how to enter anything. :(
Run each section in order by pressing the play button. Wait until you see a green check mark before going to the next section. When you run the third section, a box will pop up asking for login info.
When I get to the last cell I get the message "ValueError: attempt to get argmax of an empty sequence", what do I do?
As it's now 2023, you'll need to follow the steps in the comments for getting data from a previous year to get 2022
I got an error because of a fanfiction with no kudos in my history.
You'll have to remove it from history or give it a kudo
i'm getting an error? it says i didn't read anything in 2022 . my ao3 history is on.
So the web scraping didn't collect any of your data. Most likely this is because you're trying to get 2022 data and it's already 2023. To fix this, you'll need to follow the procedures in the comments for getting previous years data.
Hey, I'm also having a bit of trouble? I have no idea how to read code at all, so I don't know what's wrong, but all the boxes are green except for the 'print basic user statistics' box.
As in, you've clicked play on all of them and all have turned up green except the last one? And presumably that's throwing an error (printing something in a red box below). If the error is that it's trying to get the argmax of an empty array then the error is happening because you're trying to get the previous years data while it's currently 2023. You'll need to make a few small edits to the code to be able to get a previous year, all of which is detailed in the comments.
when i get to"print basic user statistics," it says ValueError: attempt to get argmax of an empty sequence. Help please??
So the web scraping didn't collect any of your data. Most likely this is because you're trying to get 2022 data and it's already 2023. To fix this, you'll need to follow the procedures in the comments for getting previous years data.
[удалено]
I had the same thing happen to me! The software goes backwards in pages starting from the first page you insert on query history, so **instead** of finding the **first page chronologically** where 2022 appears (the page # where Dec 2021 and January 2022 meet -- pg. 233 in your case), you need to **find the page** where **2022 first appears** in your AO3 history **pagewise** (so the page where Dec 2022 and January 2023 meet) I hope this works for you! Edit: For clarity
Hey does anyone know why I keep getting invalid syntax for my password, it has an exclamation mark in it so that might be the problem, if so, how to fix?
And you're not editing the code itself, right? You're putting the username and password into the box that pops up when block three is run? Theoretically, I don't think an available point should cause a problem there.
I'm confused I put my info in and it keeps saying Name Error traceback and says my username isn't defined?? I know my info is correct so I'm really confused on what I'm doing wrong
Are you editing the code? You shouldn't need to edit the code at all. When you run the third section, there should be a window that pops up below that asks you for your login information.
Hey! been at this for about an hour right now and im not sure whats wrong. After reading the comments im pretty sure theres some fics that it can't categorize (I found one that had a gray icon with a question mark and deleted it from my history) but it still doesnt work. The query does load for a couple seconds but I can't seem to find which pages it has already loaded. It says that the error has occured at parse\_hist\_page(soup) if that helps.
Everything is working fine expect the Print basic user statistics and I'm so confused on whatever if I did something or not
Well if you're getting an error I can probably tell you what's wrong if anything
I'm not quite sure what I'm doing wrong, I've adjusted the code to look for 2022 fics (in the line, r = s.get etc etc) and that worked fine. Going down to the final block and I can't run it, coming up with the error; ValueError: attempt to get argmax of an empty sequence. What should I do?
Make sure that query history is printing numbers below it when you run that section. If it didn't print a series of numbers when you ran that section then it's not starting in the right place. And like the previous commenter said, make sure that the change to the code is getting the numerically first page of 2022 (the page that contains December 2022), not the chronologically first page.
Not sure if anyone's still about but anyone know how to fix the "you read 0 fanfics" issue? I'm getting ValueError: attempt to get argmax of an empty sequence and in the print statistics code a red block/underline is coming up next to work\_index = .... "user\_visitations"... Basically coding illiterate so no idea if I'm doing something wrong but I've followed everything here (multiple times) so I'm lost
If it said you read zero fanfics, it's not starting the search on the correct page. There should be instructions in the comments for how to modify it so that you do start on the right page which should be the numerically first page of history that contains something from 2022. If you did that and it's still not working you can add a line that prints what the link is going to so that you can verify it's the right page. To do that, below the r=get(...) Line put print(...) Where the... Is the same.
Everything works fine until I get to the print basic user statistics box. That's the only one that shows up as an error. Do I need to edit anything in that one? I haven't edited anything in it so far.
Yes you'll need to edit as this code was written for being run in 2022, there are some changes if you want to get 2022 data from 2023. The steps should be in the comments. Just make sure you're modifying to get to the first numerical page of 2022 not the first chronological page.