I found this story on Futility Closet’s blog here. The original source was the Foreign Quarterly Review (Jan 1844).
Though perhaps not a true story, the Review “reports the case of Quatremer Disjonval, a Dutch adjutant-general whom the Prussians had incarcerated in a dungeon at Utrecht.
“To pass the time he studied the prison’s spiders and noted that their behavior varied with approaching weather. When a sudden thaw threatened the advance of republican troops in January 1795, Disjonval sent a letter to the French general promising a severe frost within two weeks.
“When the cold that arrived 12 days later froze Dutch canals solid enough to bear French artillery, the republicans took Utrecht and’“Quatremer Disjonval, who had watched the habits of his spiders with so much intelligence and success, was, as a reward for his ingenuity, released from prison.'”