A quick script to sum up all of the gil that you get from FFXIV's MSQ, using data scraped from the wiki.
Spoiler alert, It's somewhere around 1,109,491 gil.
Close to Home (Limsa Lominsa) | |
On to Summerford | |
Dressed to Call | |
Lurkers in the Grotto | |
Washed Up | |
Double Dealing | |
Loam Maintenance | |
Plowshares to Swords | |
Just Deserts | |
Sky-high | |
Thanks a Million | |
Relighting the Torch | |
On to the Drydocks | |
Without a Doubt | |
Righting the Shipwright | |
Do Angry Pirates Dream | |
Victory in Peril | |
Men of the Blue Tattoos | |
Feint and Strike | |
High Society | |
A Mizzenmast Repast | |
The Lominsan Envoy | |
Call of the Sea (Limsa Lominsa) | |
It's Probably Pirates | |
Call of the Forest | |
Fire in the Gloom | |
Call of the Desert | |
Into a Copper Hell | |
The Scions of the Seventh Dawn (Quest) | |
A Wild Rose by Any Other Name | |
Unsolved Mystery | |
What Poor People Think | |
A Proper Burial | |
For the Children | |
Amalj'aa Wrong Places | |
Dressed to Deceive | |
Life, Materia and Everything | |
Lord of the Inferno | |
A Hero in the Making | |
The Company You Keep (Immortal Flames) | |
For Coin and Country | |
The Company You Keep (Maelstrom) | |
Till Sea Swallows All | |
The Company You Keep (Twin Adder) | |
Wood's Will Be Done | |
Sylph-management | |
We Come in Peace | |
Sylphic Studies | |
First Impressions (MSQ) | |
First Contact | |
Dance Dance Diplomacy | |
Forest Friend | |
Presence of the Enemy | |
Brotherly Love | |
Spirited Away | |
Druthers House Rules | |
Never Forget | |
Microbrewing | |
Like Fine Wine | |
Sylphish Concerns | |
Nouveau Riche | |
Into the Beast's Maw | |
A Simple Gift | |
Believe in Your Sylph | |
Back from the Wood (Quest) | |
Shadow of Darkness | |
Highbridge Times | |
Where There Is Smoke | |
On to Little Ala Mhigo | |
Tea for Three | |
Foot in the Door | |
Meeting with the Resistance | |
Killing Him Softly | |
Helping Horn | |
He Ain't Heavy | |
Come Highly Recommended | |
The Bear and the Young'uns' Cares | |
Wilred Wants You | |
Big Trouble in Little Ala Mhigo | |
Back to Square One | |
Terror at Fallgourd | |
Ziz Is So Ridiculous | |
Rock of Rancor | |
Seeing Eye to Winged Eye | |
Power of Deduction | |
Secret of the White Lily | |
Skeletons in Her Closet | |
Wrath of the Titan | |
Tales from the Tidus Slayer | |
Hungry Hungry Goobbues | |
The Lominsan Way | |
Nix That | |
A Modest Proposal | |
Trial by Turtle | |
The Perfect Prey | |
When the Worm Turns | |
There and Back Again | |
The Things We Do for Cheese | |
What Do You Mean You Forgot the Wine | |
An Offer You Can Refuse | |
It Won't Work | |
Give a Man a Drink | |
That Weight | |
Battle Scars | |
It Was a Very Good Year | |
In the Company of Heroes | |
As You Wish | |
Lord of Crags | |
All Good Things | |
You Can't Take It with You | |
Bringing out the Dead | |
Bury Me Not on the Lone Prairie | |
Eyes on Me | |
He Who Waited Behind | |
Cold Reception | |
The Unending War | |
Men of Honor | |
Three for Three | |
The Rose and the Unicorn | |
The Talk of Coerthas | |
Road to Redemption | |
Following the Evidence | |
In the Eyes of Gods and Men | |
The Final Flight of the Enterprise | |
Ye of Little Faith | |
Factual Folklore | |
The Best Inventions | |
Influencing Inquisitors | |
By the Lights of Ishgard | |
Blood for Blood | |
The Heretic among Us | |
In Pursuit of the Past | |
Into the Eye of the Storm | |
Sealed with Science | |
With the Utmost Care | |
A Promising Prospect | |
It's Probably Not Pirates | |
Representing the Representative | |
The Reluctant Researcher | |
Sweet Somethings | |
History Repeating | |
The Curious Case of Giggity | |
Better Late than Never | |
Lady of the Vortex | |
Reclamation | |
Casing the Castrum | |
Eyes on the Empire | |
Footprints in the Snow | |
Monumental Hopes | |
Notorious Biggs | |
Come-Into-My-Castrum | |
Getting Even with Garlemald | |
Drowning Out the Voices | |
Acting the Part | |
Dressed for Conquest | |
Fool Me Twice (Quest) | |
Every Little Thing She Does Is Magitek | |
Escape from Castrum Centri | |
The Black Wolf's Ultimatum | |
Operation Archon | |
A Hero in Need | |
Hearts on Fire | |
Rock the Castrum | |
The Ultimate Weapon | |
The Price of Principles | |
Moving On | |
All Things in Time | |
Laying the Foundation | |
It's Possibly a Primal | |
Hail to the King, Kupo | |
You Have Selected Regicide | |
On the Properties of Primals | |
The Gifted | |
Build on the Stone | |
Still Waters | |
A Final Temptation | |
The Mother of Exiles | |
Promises to Keep | |
Yugiri's Game | |
Why We Adventure | |
All Due Respect | |
The Sea Rises | |
Scouts in Distress | |
The Gift of Eternity | |
Into the Heart of the Whorl | |
Lord of the Whorl | |
When Yugiri Met the Fraternity | |
Through the Maelstrom | |
The Great Divide | |
Desperate Times | |
Shock and Awe | |
Reap the Whirlwind | |
Revolution | |
Stories We Tell | |
Lord of Levin | |
Levin an Impression | |
What Little Gods Are Made Of | |
Guardian of Eorzea | |
Recruiting the Realm | |
Heretical Harassment | |
When the Cold Sets In | |
Brave New Companions | |
Traitor in the Midst | |
Back and Fourth | |
Coming to Terms | |
The Intercession of Saints | |
Strength in Unity | |
Dark Words, Dark Deeds | |
First Blood | |
The Path of the Righteous | |
For the Greater Good | |
Tendrils of Intrigue | |
Chasing Ivy | |
In Flagrante Delicto | |
A Simple Plan | |
The Instruments of Our Deliverance | |
The Road Less Traveled | |
Eyes Unclouded | |
The Reason Roaille | |
Let Us Cling Together | |
Good Intentions | |
Bait and Switch | |
Best Laid Schemes | |
The Rising Chorus | |
Aether on Demand | |
On the Counteroffensive | |
An Uninvited Ascian | |
In Memory of Moenbryda | |
Mask of Grief | |
Defenders for Ishgard | |
The Wyrm's Roar | |
Committed to the Cause | |
Volunteer Dragonslayers | |
An Allied Perspective | |
The Steps of Faith | |
Administrative Decision | |
An Unexpected Ambition | |
Ancient Ways, Timeless Wants | |
Where We Are Needed | |
The Least among Us | |
A Time to Every Purpose | |
Come, but Not Gone | |
The Parting Glass | |
Before the Dawn | |
Coming to Ishgard | |
Taking in the Sights | |
The Better Half | |
Over the Wall | |
Work in Progress | |
The First and Foremost | |
From on High | |
Reconnaissance Lost | |
At the End of Our Hope | |
Knights Be Not Proud | |
Onwards and Upwards | |
An Indispensable Ally | |
Meeting the Neighbors | |
Sense of Urgency | |
Hope Springs Eternal | |
A Series of Unfortunate Events | |
A Reward Long in Coming | |
Divine Intervention | |
Disclosure | |
Flame General Affairs | |
In Search of Raubahn | |
Keeping the Flame Alive | |
To Siege or Not to Siege | |
Alphinaud's Way | |
In Search of Iceheart | |
From One Heretic to Another | |
Sounding Out the Amphitheatre | |
Camp of the Convictors | |
Purple Flame, Purple Flame | |
Where the Chocobos Roam | |
Worse than Dragons | |
The Trine Towers | |
Gifts for the Outcasts | |
The Nonmind | |
A Gnathic Deity | |
Breaking into Hives | |
Lord of the Hive | |
Mourn in Passing | |
Beyond the Clouds | |
Mountaintop Diplomacy | |
Moghan's Trial | |
Mogmug's Trial | |
Mogwin's Trial | |
Moglin's Judgment | |
Leaving Moghome | |
The Road to Zenith | |
Waiting for the Wind to Change | |
Heart of Ice | |
The Wyrm's Lair | |
New Winds, Old Friends | |
A General Summons | |
Awakening in Ul'dah | |
A Brave Resolution | |
Ready to Fly | |
Into the Aery | |
The Song Begins | |
Unrest in Ishgard | |
He Who Would Not Be Denied | |
Ill-weather Friends | |
The Spice of Life | |
Noble Indiscretions | |
A Child Apart | |
Bloodlines | |
Fire and Blood | |
A Knight's Calling | |
The Sins of Antiquity | |
In Search of the Soleil | |
Into the Blue | |
Familiar Faces | |
Devourer of Worlds | |
Black and the White | |
Bolt, Chain, and Island | |
A Difference of Opinion | |
One Good Turn | |
An Engineering Enterprise | |
Aetherial Trail | |
Lost in the Lifestream | |
Tataru's Surprise | |
Onward to Sharlayan | |
A Great New Nation | |
Golems Begone | |
An Illuminati Incident | |
Leaving Idyllshire | |
Matoya's Cave (Quest) | |
Forbidden Knowledge | |
An Eye for Aether | |
Hour of Departure | |
The First Flight of the Excelsior | |
Systematic Exploration | |
In Node We Trust | |
Chimerical Maintenance | |
Close Encounters of the VIth Kind | |
Fetters of Lament | |
Heavensward (Quest) | |
An Uncertain Future | |
Breaking the Cycle | |
Another Time, Another Place | |
In the Eye of the Beholder | |
A Little Slow, a Little Late | |
Dreams of the Lost | |
Against the Dying of the Light | |
As Goes Light, So Goes Darkness | |
As It Once Was | |
The Word of the Mother | |
This War of Ours | |
Staunch Conviction | |
Once More, a Favor | |
For Those We Have Lost | |
Consequences | |
Choices | |
A Spectacle for the Ages | |
For Those We Can Yet Save | |
Causes and Costs | |
The Man Within | |
An Ally for Ishgard | |
Winning Over the Wyrm | |
An End to the Song | |
Heroes of the Hour | |
Litany of Peace | |
Promises Kept | |
Shadows of the First | |
Two Sides of a Coin | |
Unlikely Allies | |
The Beast That Mourned at the Heart of the Mountain | |
Beneath a Star-filled Sky | |
When We Were Free | |
Honorable Heroes | |
One Life for One World | |
An Ending to Mark a New Beginning | |
Tidings from Gyr Abania | |
An Envoy for Ishgard | |
An Allied Decision | |
Griffin, Griffin on the Wall | |
Louisoix's Finest Student | |
The Obvious Solution | |
The Greater Obeisance | |
Fly Free, My Pretty | |
The Far Edge of Fate | |
Beyond the Great Wall | |
Lyse Takes the Lead | |
The Promise of a New Beginning | |
A Haven for the Bold | |
A Bargain Struck | |
A Friend of a Friend in Need | |
Signed, Sealed, to Be Delivered | |
Best Served with Cold Steel | |
Let Fill Your Hearts with Pride | |
A Familiar Face Forgotten | |
The Prodigal Daughter | |
Hard Country | |
Death by a Thousand Rocks | |
A Life More Ordinary | |
The Color of Angry Qiqirn | |
The Black Wolf's Pups | |
Homeward Bound | |
Where Men Go as One | |
Future Rust, Future Dust | |
A Dash of Green | |
Ye Wayward Brothers | |
Token of Faith | |
Crossing the Velodyna | |
In Crimson It Began | |
The Fires Fade | |
Bereft of Hearth and Home | |
Divide and Conquer | |
Lies, Damn Lies, and Pirates | |
Tales from the Far East | |
Not without Incident | |
The Man from Ul'dah | |
Where the Streets Are Paved with Koban | |
By the Grace of Lord Lolorito | |
A Good Samurai Is Hard to Find | |
It's Probably a Trap | |
Making the Catfish Sing | |
Once More, to the Ruby Sea | |
Open Water | |
Boys with Boats | |
To Bend with the Wind | |
Confederate Consternation | |
The Solace of the Sea | |
The Arrows of Misfortune | |
The Last Voyage | |
Alisaie's Stones | |
Under the Sea | |
Of Kojin and Kami | |
In Soroban We Trust | |
Forever and Ever Apart | |
In Darkness the Magatama Dreams | |
The Whims of the Divine | |
Breaking and Delivering | |
The Lord of the Revel | |
Tide Goes in, Imperials Go Out | |
A Silence in Three Parts | |
Life after Doma | |
A Glimpse of Madness | |
The Stubborn Remainder | |
The Ones We Leave Behind | |
A New Ruby Tithe | |
The Will to Live | |
Daughter of the Deep | |
Path of No Return | |
The Time between the Seconds | |
All the Little Angels | |
Here There Be Xaela | |
The Search for Lord Hien | |
A Season for War | |
An Impossible Dream | |
Stars in the Dark | |
A Warrior's Welcome | |
The Heart of Nations | |
A Trial Before the Trial | |
In the Footsteps of Bardam the Brave | |
The Children of Azim | |
The Labors of Magnai | |
For Love of the Moon | |
Sworn Enemies of the Sun | |
The Undying Ones | |
A Final Peace | |
As the Gods Will | |
Naadam | |
Glory to the Khagan | |
In Crimson They Walked | |
The Hour of Reckoning | |
The Room Where It Happened | |
How Tataru Got Her Groove Back | |
Seeds of Despair | |
The Limits of Our Endurance | |
Broken Steel, Broken Men | |
The Doma Within | |
On the Eve of Destiny | |
The Die Is Cast | |
The World Turned Upside Down | |
A Swift and Secret Departure | |
While You Were Away | |
Rhalgr's Beacon | |
The Fortunes of War | |
Rising Fortunes, Rising Spirits | |
The Lure of the Dream | |
The Lady of Bliss | |
The Silence of the Gods | |
The First of Many | |
Strong and Unified | |
Hells Open | |
Heavens Weep | |
The Road Home | |
For the Living and the Dead | |
Above the Churning Waters | |
The Path Forward | |
With Tired Hands We Toil | |
Where Courage Endures | |
The Price of Freedom | |
Raubahn's Invitation | |
Liberty or Death | |
The Lady in Red | |
Upon the Great Loch's Shore | |
The Key to Victory | |
The Resonant | |
The Legacy of Our Fathers | |
The Measure of His Reach | |
Stormblood (Quest) | |
Arenvald's Adventure | |
The Darkness Below | |
The Mad King's Trove | |
The Butcher's Blood | |
Echoes of an Echo | |
A Sultana's Strings | |
A Sultana's Duty | |
A Sultana's Resolve | |
Securing the Saltery | |
A Blissful Arrival | |
Return of the Bull | |
Tidings from the East | |
The Sword in the Store | |
Hope on the Waves | |
Elation and Trepidation | |
Storm on the Horizon | |
His Forgotten Home | |
A Guilty Conscience | |
Rise of a New Sun | |
Gosetsu and Tsuyu | |
Gone Like the Morning Dew | |
Fruits of Her Labor | |
Conscripts and Contingencies | |
The Primary Agreement | |
Under the Moonlight | |
Emissary of the Dawn | |
Sisterly Act | |
Feel the Burn | |
Shadows in the Empire | |
A Power in Slumber | |
The Will of the Moon | |
The Call | |
Prelude in Violet | |
Soul Searching | |
A Defector's Tidings | |
Seiryu's Wall | |
Parley on the Front Lines | |
The Face of War | |
A Brief Reprieve | |
A Requiem for Heroes | |
The Syrcus Trench | |
City of the First | |
Travelers of Norvrandt | |
In Search of Alphinaud | |
A Still Tide | |
Open Arms, Closed Gate | |
A Fickle Existence | |
City of Final Pleasures | |
Free to Sightsee | |
A Taste of Honey | |
A Blessed Instrument | |
Emergent Splendor | |
In Search of Alisaie | |
City of the Mord | |
Working Off the Meal | |
A Desert Crossing | |
Following in Her Footprints | |
Culling Their Ranks | |
A Purchase of Fruit | |
The Time Left to Us | |
Tears on the Sand | |
The Lightwardens | |
Warrior of Darkness (Quest) | |
An Unwelcome Guest | |
The Crystarium's Resolve | |
Logistics of War | |
The Oracle of Light | |
Il Mheg, the Faerie Kingdom | |
Sul Uin's Request | |
Ys Iala's Errand | |
Oul Sigun's Plea | |
Unto the Truth | |
Courting Cooperation | |
The Key to the Castle | |
A Visit to the Nu Mou | |
A Fitting Payment | |
Spore Sweeper | |
The Lawless Ones | |
The Elder's Answer | |
A Resounding Roar | |
Memento of a Friend | |
Acht-la Ormh Inn | |
The Wheel Turns | |
A Party Soon Divided | |
A Little Faith | |
Into the Dark | |
A Day in the Neighborhood | |
A Helping Hand | |
Lost but Not Forgotten | |
Saying Good-bye | |
Stirring up Trouble | |
A Beeautiful Plan | |
An Unwanted Proposal | |
Put to the Proof | |
Into the Wood | |
Top of the Tree | |
Look to the Stars | |
Mi Casa, Toupasa | |
Legend of the Not-so-hidden Temple | |
The Aftermath | |
In Good Faith | |
The Burden of Knowledge | |
Bearing with It | |
Out of the Wood | |
When It Rains | |
Word from On High | |
Small Favors | |
The Best Way Out | |
Free Trade | |
The Trolley Problem | |
Rust and Ruin | |
On Track | |
Down for Maintenance | |
The Truth Hurts | |
A Convenient Distraction | |
A Dirty Job | |
Have a Heart | |
Full Steam Ahead | |
Crossroads | |
A Fresh Start | |
More than a Hunch | |
Return to Eulmore | |
A Feast of Lies | |
Paradise Fallen | |
The Ladder | |
The View from Above | |
In Mt. Gulg's Shadow | |
A Gigantic Undertaking | |
Meet the Tholls | |
A-Digging We Will Go | |
The Duergar's Tewel | |
Rich Veins of Hope | |
That None Shall Ever Again | |
A Breath of Respite | |
Extinguishing the Last Light | |
Reassuring the Masses | |
In His Garden | |
The Unbroken Thread | |
To Storm-tossed Seas | |
Waiting in the Depths | |
City of the Ancients | |
The Light of Inspiration | |
The Illuminated Land | |
The End of a World | |
A Greater Purpose | |
Shadowbringers (Quest) | |
Shaken Resolve | |
A Grand Adventure | |
A Welcome Guest | |
Good for the Soul | |
Nowhere to Turn | |
A Notable Absence | |
For the People | |
Finding Good Help | |
Moving Forward | |
Vows of Virtue, Deeds of Cruelty | |
Old Enemies, New Threats | |
The Way Home | |
Seeking Counsel | |
Facing the Truth | |
A Sleep Disturbed | |
An Old Friend | |
Deep Designs | |
A Whale's Tale | |
Beneath the Surface | |
Echoes of a Fallen Star | |
In the Name of the Light | |
Heroic Dreams | |
Fraying Threads | |
Food for the Soul | |
Faded Memories | |
Etched in the Stars | |
The Converging Light | |
Hope's Confluence | |
Nothing Unsaid | |
The Journey Continues | |
Unto the Morrow | |
Reflections in Crystal | |
Alisaie's Quest | |
The Wisdom of Allag | |
Reviving the Legacy | |
Forget Us Not | |
Like Master, Like Pupil | |
The Admiral's Resolve | |
The Search for Sicard | |
On Rough Seas | |
The Great Ship Vylbrand | |
Futures Rewritten | |
Unto the Breach | |
Here Be Dragons | |
Righteous Indignation | |
For Vengeance | |
The Flames of War | |
When the Dust Settles | |
The Company We Keep | |
On Official Business | |
Death Unto Dawn | |
The Next Ship to Sail | |
Old Sharlayan, New to You | |
Hitting the Books | |
A Seat at the Last Stand | |
A Labyrinthine Descent | |
Glorified Ratcatcher | |
Deeper into the Maze | |
The Medial Circuit | |
The Full Report, Warts and All | |
A Guide of Sorts | |
Estate Visitor | |
For Thavnair Bound | |
On Low Tide | |
A Fisherman's Friend | |
House of Divinities | |
The Great Work | |
Shadowed Footsteps | |
A Boy's Errand | |
Tipping the Scale | |
The Satrap of Radz-at-Han | |
In the Dark of the Tower | |
The Jewel of Thavnair | |
The Color of Joy | |
Sound the Bell, School's In | |
A Capital Idea | |
Best of the Best | |
A Frosty Reception | |
Tracks in the Snow | |
How the Mighty Are Fallen | |
At the End of the Trail | |
A Way Forward | |
The Last Bastion | |
Personae non Gratae | |
His Park Materials | |
No Good Deed | |
Alea Iacta Est | |
Strange Bedfellows | |
In from the Cold | |
Gateway of the Gods | |
A Trip to the Moon | |
Sea of Sorrow | |
The Martyr | |
In Shadow's Wake | |
Helping Hands | |
A Harey Situation | |
A Taste of the Moon | |
Styled a Hero | |
All's Vale That Endsvale | |
Back to Old Tricks | |
Setting Things Straight | |
Heart of the Matter | |
Returning Home | |
Skies Aflame | |
The Blasphemy Unmasked | |
Amidst the Apocalypse | |
Beyond the Depths of Despair | |
That We Might Live | |
When All Hope Seems Lost | |
Warm Hearts, Rekindled Hopes | |
Simple Pleasures | |
Under His Wing | |
At World's End | |
Return to the Crystarium | |
Hope Upon a Flower | |
Petalouda Hunt | |
In Search of Hermes | |
Ponder, Warrant, Cherish, Welcome | |
Lives Apart | |
Their Greatest Contribution | |
Aether to Aether | |
A Sentimental Gift | |
Verdict and Execution | |
Travelers at the Crossroads | |
A Past, Not Yet Come to Pass | |
Witness to the Spectacle | |
Worthy of His Back | |
A Flower upon Your Return | |
Hunger in the Garden | |
Words without Sound | |
Follow, Wander, Stumble, Listen | |
Caging the Messenger | |
Thou Must Live, Die, and Know | |
As the Heavens Burn | |
Outside Help | |
Going Underground | |
No Job Too Small | |
Wise Guides | |
Agriculture Shock | |
Sage Council | |
Hither and Yarns | |
Once Forged | |
Bonds of Adamant(ite) | |
Her Children, One and All | |
A Bold Decision | |
Friends Gathered | |
Unto the Heavens | |
A §trαnge New World | |
On Burdεned ωings | |
A Test of Wιll | |
Roads Pαved││Sacri┣ice | |
F//εsh AbanΔon┨Δ | |
Where Kn∞wledge Leads | |
Vic┨οry ̈ ̈ ̈╳, │̆││ε Lost | |
┣┨̈//̈ No┨ΦounΔ••• | |
Hello, World | |
Forge Ahead | |
You're Not Alone | |
Endwalker (Quest) | |
Newfound Adventure | |
Bountiful Ruins | |
Friends for the Road | |
Alzadaal's Legacy (Quest) | |
A Brother's Grief | |
Sharing the Wealth | |
Bridging the Rift | |
Restricted Reading | |
Void Theory | |
A Satrap's Duty | |
In Search of Azdaja | |
Shadowed Remnants | |
Where Everything Begins | |
Groping in the Dark | |
Nowhere to Run | |
The Wind Rises | |
Return from the Void | |
A World with Light and Life | |
Buried Memory | |
Once More unto the Void | |
A Cold Reunion | |
Kindled Spirit | |
An Unforeseen Bargain | |
King of the Mountain | |
A Dragon's Resolve | |
Paths Barred | |
Desires Untold | |
Gods Revel, Lands Tremble | |
Currying Flavor | |
Going Haam | |
Like Fear to Flame | |
The Fallen Empire | |
Bonds of Trust | |
Lunar Rendezvous | |
The Red Side of the Moon | |
Abyssal Dark | |
The Dark Throne | |
Seeking the Light | |
Appealing to the Masses | |
In Defiance of Fate | |
Back to Action | |
Down in the Dark | |
Reunited at Last | |
Growing Light |
#!/usr/bin/env python3 | |
import re | |
import time | |
import sys | |
import math | |
import requests | |
from multiprocessing import Pool, TimeoutError | |
BASE_URL = "https://ffxiv.consolegameswiki.com/mediawiki/api.php" | |
QUESTS = "all_ffxiv_msq_quests.txt" | |
GIL_FILTER = re.compile(r"gil = (\d+)") | |
THREADS = 8 | |
def thread(id: int, list: list) -> int: | |
total = 0 | |
for i in range(len(list)): | |
page = list[i].strip() | |
queries = { | |
"action": "parse", | |
"format": "json", | |
"page": page, | |
"prop": "wikitext", | |
"section": 0 | |
} | |
res = requests.get(url=BASE_URL, params=queries) | |
gil = parse_gil(res.text) | |
total += gil | |
print(f"Thread {id}: {page} - {gil} [{i}/{len(list)}] [Total: {total}]") | |
# no ddos :) | |
time.sleep(1) | |
return total | |
def parse_gil(text: str) -> int: | |
res = GIL_FILTER.search(text) | |
if not res: | |
print('Failed to parse gil from text:', file=sys.stderr) | |
print(text, file=sys.stderr) | |
return 0 | |
return int(res.group(1)) | |
if __name__ == "__main__": | |
with open(QUESTS, "r") as file: | |
data = file.read().splitlines() | |
print("Lines:", len(data)) | |
print("Threads:", THREADS) | |
step = math.ceil(len(data) / THREADS) | |
print("Step:", step) | |
split = [data[x:x+step] for x in range(0, len(data), step)] | |
with Pool(processes=THREADS) as pool: | |
results = [ | |
pool.apply_async(thread, (i, split[i])) | |
for i in range(THREADS) | |
] | |
values = [ | |
res.get(timeout=3600) for res in results | |
] | |
print("Sum:", sum(values)) |