MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / createPage

Method createPage

outdated/gemini/gemini.ts:551–571  ·  view source on GitHub ↗
(title: string, htmlContent: string)

Source from the content-addressed store, hash-verified

549 }
550
551 async createPage(title: string, htmlContent: string): Promise<{ url: string; path: string }> {
552 const token = await this.getAccessToken();
553
554 const response = await HttpClient.makeRequest('https://api.telegra.ph/createPage', {
555 method: 'POST',
556 data: {
557 access_token: token,
558 title,
559 content: [{ tag: 'div', children: [htmlContent] }]
560 }
561 });
562
563 if (response.status === 200 && response.data.ok) {
564 return {
565 url: response.data.result.url || '',
566 path: response.data.result.path || ''
567 };
568 }
569
570 throw new Error('Failed to create Telegraph page');
571 }
572
573 async editPage(path: string, title: string, htmlContent: string): Promise<boolean> {
574 try {

Callers

nothing calls this directly

Calls 2

getAccessTokenMethod · 0.95
makeRequestMethod · 0.45

Tested by

no test coverage detected