Skip to main content
Glama
jonathan-politzki

Official Substack MCP Server

base.cpython-313.pyc2.8 kB
� �@�gR��t�SrSSKJrJr SSKJr SSKJr SSKJrJ r \"SS55r "SS \5r g ) z9 Base scraper functionality for Writer Context Protocol. �)�ABC�abstractmethod)� dataclass)�datetime)�List�Optionalc�n�\rSrSr%Sr\\S'\\S'\\S'Sr\\ \S'Sr \\S 'S r \ \S 'S r S rg)�Post� z8Representation of a blog post with content and metadata.�title�url�contentN�date��subtitler� word_countc��UR(d;UR(a)[URR55Ulggg)z%Calculate word count if not provided.N)rr�len�split��selfs �K/Users/jonathanpolitzki/Desktop/Coding/mcp-writer-substack/scrapers/base.py� __post_init__�Post.__post_init__s/�����4�<�<�!�$�,�,�"4�"4�"6�7�D�O�$0��)r)�__name__� __module__� __qualname__�__firstlineno__�__doc__�str�__annotations__rrrrr�intr�__static_attributes__�rrr r s<��B� �J� �H� �L�#�D�(�8� �#��H�c���J���8rr c�h�\rSrSrSrS S\S\4Sjjr\S\S\4Sj5r \ S\ \ 4Sj5r S rg ) � BaseScraper�z*Base class for platform-specific scrapers.r � max_postsc�<�URU5UlX lg)z� Initialize a scraper with configuration. Args: url: The URL of the blog to scrape max_posts: Maximum number of posts to retrieve N)�_normalize_urlr r))rr r)s r�__init__�BaseScraper.__init__s���&�&�s�+���"�r�returnc�<�URS5(dUS- nU$)z~ Normalize a URL to ensure consistency. Args: url: URL to normalize Returns: Normalized URL with trailing slash �/)�endswith)r s rr+�BaseScraper._normalize_url(s!���|�|�C� � � �3�J�C�� rc�� # �g7f)zq Scrape posts from the configured platform. Returns: A list of Post objects containing content and metadata Nr%rs r�scrape�BaseScraper.scrape7s ��� �s�)r)r N)r )rrrrr r!r#r,� staticmethodr+rrr r4r$r%rrr'r'sY��4� #�C� #�C� #�� �C� �C� �� �� �d�4�j� �� rr'N) r �abcrr� dataclassesrr�typingrrr r'r%rr�<module>r:s=���$�!��!� � 8� 8� � 8�% �#�% r

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jonathan-politzki/mcp-writer-substack'

If you have feedback or need assistance with the MCP directory API, please join our Discord server