{"id":20633161,"url":"https://github.com/marcoscostadev/telegraphconnector","last_synced_at":"2025-07-07T13:33:48.358Z","repository":{"id":64961007,"uuid":"578863028","full_name":"MarcosCostaDev/TelegraphConnector","owner":"MarcosCostaDev","description":"TelegraphConnector is a Nuget package that lets you easily communicate with the Telegra.ph API and create and publish web pages using Telegra.ph resources. It has a wide range of features and functionality and lets you publish articles and share multimedia content. It's easy to use with simple methods and comprehensive documentation.","archived":false,"fork":false,"pushed_at":"2023-01-03T17:30:57.000Z","size":102,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T19:08:13.275Z","etag":null,"topics":["telegram","telegraph","telegraph-api","telegraph-downloader","telegraph-publishing"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarcosCostaDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-16T03:56:18.000Z","updated_at":"2025-02-16T11:39:51.000Z","dependencies_parsed_at":"2023-01-12T07:15:32.751Z","dependency_job_id":null,"html_url":"https://github.com/MarcosCostaDev/TelegraphConnector","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcosCostaDev%2FTelegraphConnector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcosCostaDev%2FTelegraphConnector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcosCostaDev%2FTelegraphConnector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcosCostaDev%2FTelegraphConnector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcosCostaDev","download_url":"https://codeload.github.com/MarcosCostaDev/TelegraphConnector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249135823,"owners_count":21218365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["telegram","telegraph","telegraph-api","telegraph-downloader","telegraph-publishing"],"created_at":"2024-11-16T14:19:00.612Z","updated_at":"2025-04-15T19:12:41.445Z","avatar_url":"https://github.com/MarcosCostaDev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegraph Connector!\n\n| Build | Latest Version | TelegraphConnector | TelegraphConnector.Parses |\n|--------|--------|--------|-------|\n| [![Build](https://github.com/MarcosCostaDev/TelegraphConnector/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/MarcosCostaDev/TelegraphConnector/actions/workflows/build-and-test.yml)| ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/marcoscostadev/TelegraphConnector) | [![Nuget](https://img.shields.io/nuget/v/TelegraphConnector)](https://www.nuget.org/packages/TelegraphConnector/) | [![Nuget](https://img.shields.io/nuget/v/TelegraphConnector.Parses?logo=%20)](https://www.nuget.org/packages/TelegraphConnector.Parses/) |\n| | | ![Nuget](https://img.shields.io/nuget/dt/TelegraphConnector) | ![Nuget](https://img.shields.io/nuget/dt/TelegraphConnector.Parses) |\n\n \n\n\nIntroducing TelegraphConnector - the Nuget package that makes it easy to communicate with the [Telegra.ph](https://telegram.org/blog/telegraph) [API](https://telegra.ph/api) for enabling the [Telegram instant view](https://telegram.org/blog/instant-view) for a HTML, Markdown or text files. With this package, you can easily create and publish web pages using resources from Telegra.ph, giving you access to a wide range of features and functionality.\n\nWhether you want to publish articles, or share multimedia content, TelegraphConnector makes it simple and straightforward to do so. Simply install the package, create or authenticate with your Telegra.ph account, and start building your web page for use in the Telegram instant view feature.\n\nWith easy-to-use methods and comprehensive documentation, TelegraphConnector is the perfect choice for anyone looking to utilize the power of Telegra.ph.\n\n\n## Installation\n\nTo install TelegraphConnector, run the following command in the Package Manager Console:\n\n```\nInstall-Package TelegraphConnector\n```\nOr use the `dotnet cli`:\n\n```\ndotnet add package TelegraphConnector\n```\n\n## Usage\n\nFirst, Create an account using the Authenticate method. Then, use the various methods provided by the package to create and publish your web pages.\n\n### Create an Account\n\n```csharp\nusing TelegraphConnector.Types;\nusing TelegraphConnector.Services;\n\n// Create an account\n Account account = Account.Create(\"My Name\", \"My Full Name\", \"https://github.com/MarcosCostaDev/TelegraphConnector\");\n\n// AccountService is used for accessing the Telegraph API\n AccountService accountService = new AccountService();\n\n// Every service returns a TelegraphResponse that contains a \n// Result property with the object listed in the types TelegraphConnector.Types \n// Accordingly with the service called.\n// The object that represents your account will be in \"response.Result\"\n TelegraphResponse\u003cAccount\u003e response = await accountService.CreateAccountAsync(account);\n```\n\nAfter create your account, keep the `response.Result.AccessToken` in a save place. The `AccessToken` will be useful for the other methods.\n\n### Create a Hello World Page\n```csharp\n// Create a text node that is used for writing a single text in your page\nNode helloWorldText = Node.CreateTextNode(\"Hello World\");\n\n// Initiate a array of nodes, you can send multiple notes to create and edit a page in the telegaph\nNode[] nodes = new Node[] {\n      Node.CreateParagraph(helloWorldText)\n};\n\n// use your account object received in the 'Create an Account' section\n// the 'true' value here will return the entire object represented your page when you call the Page Service\nPage page = Page.Create(account, \"Hello World Page\", nodes, true);\n\n// Initialize a Page Service that will manage your pages in the telegraph\nPageService pageService = new PageService();\n\n// Create a page in the Telegraph.\nTelegraphResponse\u003cPage\u003e createdPage = await pageService.CreatePageAsync(account.AccessToken, page);\n\n```\n\n\n## Telegraph Connector Parses !\n\nEnhance your Telegra.ph experience with TelegraphConnector.Parses - the extension for TelegraphConnector that allows you to import HTML and Markdown files for use within the TelegraphConnector package.\n\nWith this extension, you can easily incorporate external content into your web page, giving you even more flexibility and control. Simply install the extension, authenticate with your Telegra.ph account, and start importing your files.\n\nWhether you want to incorporate existing content or create something new, TelegraphConnector.Parse makes it easy to do so. With its easy-to-use methods and comprehensive documentation, TelegraphConnector.Parse is a must-have for anyone using TelegraphConnector.\n\n\n## Installation\n\nTo install TelegraphConnector.Parses, run the following command in the Package Manager Console:\n\n```\nInstall-Package TelegraphConnector.Parses\n```\nOr use the `dotnet cli`:\n\n```\ndotnet add package TelegraphConnector.Parses\n```\n\n\n### HTML Parse\n\n```csharp\n  using TelegraphConnector.Parses;\n  using TelegraphConnector.Services;\n  using TelegraphConnector.Types;\n\n  string html = @\"\n   \u003chtml\u003e\n   \u003chead\u003e\n   \u003c/head\u003e\n   \u003cbody\u003e\n       \u003cp class='some-class' data-id='123'\u003eHello World!\u003c/p\u003e\n   \u003c/body\u003e\n   \u003c/html\u003e\n  \";\n\n  // Get the nodes based on html text\n  Node[] nodes = TelegraphHtml.Parse(html).ToArray();\n\n  // use your account object received in the 'Create an Account' section\n  // the 'true' value here will return the entire object represented your page when you call the Page Service\n  Page page = Page.Create(account, \"Hello World Page\", nodes, true);\n\n  // Initialize a Page Service that will manage your pages in the telegraph\n  PageService pageService = new PageService();\n\n  // Create a page in the Telegraph.\n  TelegraphResponse\u003cPage\u003e createdPage = await pageService.CreatePageAsync(account.AccessToken, page);\n```\n\n\n### Markdown Parse\n\n\n```csharp\n  using TelegraphConnector.Parses;\n  using TelegraphConnector.Services;\n  using TelegraphConnector.Types;\n\n  string markdown = @\"\n    # Hello World\n\n    Hello World Paragraph.\n  \";\n\n  // Get the nodes based on markdown text\n  Node[] nodes = TelegraphMarkdown.Parse(markdown).ToArray();\n\n  // use your account object received in the 'Create an Account' section\n  // the 'true' value here will return the entire object represented your page when you call the Page Service\n  Page page = Page.Create(account, \"Hello World Page\", nodes, true);\n\n  // Initialize a Page Service that will manage your pages in the telegraph\n  PageService pageService = new PageService();\n\n  // Create a page in the Telegraph.\n  TelegraphResponse\u003cPage\u003e createdPage = await pageService.CreatePageAsync(account.AccessToken, page);\n```\n\n## Preview Versions\n\nIf you want to install the most recent preview versions, create a `NuGet.config` file and place it into your solution.\nUse the path `[your-solution-dir]/.nuget/nuget.Config` or `[your-solution-dir]/nuget.Config`\n\n```xml\n\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cconfiguration\u003e\n  \u003cpackageSources\u003e\n    \u003c!--To inherit the global NuGet package sources remove the \u003cclear/\u003e line below --\u003e\n    \u003cclear /\u003e\n    \u003cadd key=\"nuget\" value=\"https://api.nuget.org/v3/index.json\" /\u003e\n    \u003c!-- Add this line --\u003e\n    \u003cadd key=\"github\" value=\"https://nuget.pkg.github.com/marcoscostadev/index.json\" /\u003e \n  \u003c/packageSources\u003e\n\u003c/configuration\u003e\n\n```\n\n## Support \n\nFor any questions or issues, please create an [issue](https://github.com/MarcosCostaDev/TelegraphConnector/issues/new) in this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoscostadev%2Ftelegraphconnector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcoscostadev%2Ftelegraphconnector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoscostadev%2Ftelegraphconnector/lists"}