You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-06-18 05:04:13 +02:00
Main build (Jenkins)
This commit is contained in:
@@ -208,7 +208,7 @@ ___
|
||||
<summary>Синопсис</summary>
|
||||
<br>
|
||||
|
||||
Этот проект предоставляет библиотеку для интеграции 1С:Предприятие, OneScript и CLI с внешними сервисами через REST API и другие протоколы. Благодаря представленным в ней методам вы можете работать в экосистеме 1С:Предприятие с такими сервисами и технологиями как: Airtable, Bitrix24, CDEK, ClickHouse, Dropbox, FTP(S), Google Calendar, Google Drive, GreenAPI (WhatsApp), GreenAPI (Max), gRPC, Google Sheets, RSS/Atom, MongoDB, MS SQL, MySQL, Neocities, Notion, Ollama, OpenAI, PostgreSQL, RCON, ReportPortal, AWS S3, SFTP, Slack, SQLite, SSH, TCP, Telegram, Twitter (X), Viber, VK, VK Teams, Yandex.Disk, HTTP
|
||||
Этот проект предоставляет библиотеку для интеграции 1С:Предприятие, OneScript и CLI с внешними сервисами через REST API и другие протоколы. Благодаря представленным в ней методам вы можете работать в экосистеме 1С:Предприятие с такими сервисами и технологиями как: Airtable, Bitrix24, CDEK, ClickHouse, Dropbox, FTP(S), Google Calendar, Google Drive, GreenAPI (WhatsApp), GreenAPI (Max), gRPC, Google Sheets, MongoDB, MS SQL, MySQL, Neocities, Notion, Ollama, OpenAI, PostgreSQL, RCON, ReportPortal, RSS/Atom, AWS S3, SFTP, Slack, SQLite, SSH, TCP, Telegram, Twitter (X), Viber, VK, VK Teams, Yandex.Disk, HTTP
|
||||
|
||||
Существуют варианты поставки в виде расширения (.cfe, XML, EDT), OPM-пакета и других пакетов для разных операционных систем. Версия 1С: 8.3.10. Подходит для любых конфигураций, не использует БСП
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
BC910DFB58667D4F2EB594306504DDCA92AED1079A40C2D465C586AED564B673
|
||||
56083FDD3BA5A392AEAA76F1DB1735E8C1B69114CD8A2E2B7633A303F2AB8990
|
||||
Vendored
+5
-5
@@ -393,7 +393,6 @@ li > a.menu__link {
|
||||
.GreenMax a::before,
|
||||
.GRPC a::before,
|
||||
.GoogleSheets a::before,
|
||||
.RSS a::before,
|
||||
.MongoDB a::before,
|
||||
.MSSQL a::before,
|
||||
.MySQL a::before,
|
||||
@@ -404,6 +403,7 @@ li > a.menu__link {
|
||||
.PostgreSQL a::before,
|
||||
.RCON a::before,
|
||||
.ReportPortal a::before,
|
||||
.RSS a::before,
|
||||
.S3 a::before,
|
||||
.SFTP a::before,
|
||||
.Slack a::before,
|
||||
@@ -469,10 +469,6 @@ li > a.menu__link {
|
||||
content: url(../../static/img/APIs/small/GoogleSheets.png);
|
||||
}
|
||||
|
||||
.RSS > div > a::before{
|
||||
content: url(../../static/img/APIs/small/RSS.png);
|
||||
}
|
||||
|
||||
.MongoDB > div > a::before{
|
||||
content: url(../../static/img/APIs/small/MongoDB.png);
|
||||
}
|
||||
@@ -513,6 +509,10 @@ li > a.menu__link {
|
||||
content: url(../../static/img/APIs/small/ReportPortal.png);
|
||||
}
|
||||
|
||||
.RSS > div > a::before{
|
||||
content: url(../../static/img/APIs/small/RSS.png);
|
||||
}
|
||||
|
||||
.S3 > div > a::before{
|
||||
content: url(../../static/img/APIs/small/S3.png);
|
||||
}
|
||||
|
||||
+10689
-10689
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
||||
BC910DFB58667D4F2EB594306504DDCA92AED1079A40C2D465C586AED564B673
|
||||
56083FDD3BA5A392AEAA76F1DB1735E8C1B69114CD8A2E2B7633A303F2AB8990
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
BC910DFB58667D4F2EB594306504DDCA92AED1079A40C2D465C586AED564B673
|
||||
56083FDD3BA5A392AEAA76F1DB1735E8C1B69114CD8A2E2B7633A303F2AB8990
|
||||
Vendored
+1
-1
@@ -22,7 +22,7 @@
|
||||
<module name="OPI_PostgreSQL" file="postgres/Modules/OPI_PostgreSQL.os"/>
|
||||
<module name="OPI_RCON" file="rcon/Modules/OPI_RCON.os"/>
|
||||
<module name="OPI_ReportPortal" file="rportal/Modules/OPI_ReportPortal.os"/>
|
||||
<module name="OPI_RSS" file="metrika/Modules/OPI_RSS.os"/>
|
||||
<module name="OPI_RSS" file="rss/Modules/OPI_RSS.os"/>
|
||||
<module name="OPI_S3" file="s3/Modules/OPI_S3.os"/>
|
||||
<module name="OPI_SFTP" file="sftp/Modules/OPI_SFTP.os"/>
|
||||
<module name="OPI_Slack" file="slack/Modules/OPI_Slack.os"/>
|
||||
|
||||
+581
@@ -0,0 +1,581 @@
|
||||
// OneScript: ./OInt/api/rss/Modules/OPI_RSS.os
|
||||
// Lib: RSS
|
||||
// CLI: rss
|
||||
// Keywords: rss, atom, feed
|
||||
|
||||
// DocsCategory: Other
|
||||
// DocsNameRU: RSS/Atom
|
||||
// DocsNameEN: RSS/Atom
|
||||
|
||||
// MIT License
|
||||
|
||||
// Copyright (c) 2023-2026 Anton Tsitavets
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
// https://github.com/Bayselonarrend/OpenIntegrations
|
||||
|
||||
// BSLLS:Typo-off
|
||||
// BSLLS:LatinAndCyrillicSymbolInWord-off
|
||||
// BSLLS:IncorrectLineBreak-off
|
||||
// BSLLS:NumberOfOptionalParams-off
|
||||
// BSLLS:UsingServiceTag-off
|
||||
// BSLLS:LineLength-off
|
||||
// BSLLS:UsingSynchronousCalls-off
|
||||
|
||||
//@skip-check module-structure-top-region
|
||||
//@skip-check module-structure-method-in-regions
|
||||
//@skip-check wrong-string-literal-content
|
||||
//@skip-check method-too-many-params
|
||||
|
||||
#Use "../../../tools/main"
|
||||
#Use "../../../tools/http"
|
||||
|
||||
#Region Public
|
||||
|
||||
#Region RSSMethods
|
||||
|
||||
// Create feed (RSS)
|
||||
// Creates RSS feed text
|
||||
//
|
||||
// Parameters:
|
||||
// ChannelTitle - String - Channel title - name
|
||||
// ChannelDescription - String - Channel description - descr
|
||||
// ChannelLink - String - Channel link - link
|
||||
// Items - Array of Structure - Feed items. See GetFeedItemStructureRSS - items
|
||||
// UpdateDate - Date, Undefined - Update date. Current if not filled - date
|
||||
//
|
||||
// Returns:
|
||||
// String - Channel XML feed
|
||||
Function CreateFeedRSS(Val ChannelTitle
|
||||
, Val ChannelDescription
|
||||
, Val ChannelLink
|
||||
, Val Items
|
||||
, Val UpdateDate = Undefined) Export
|
||||
|
||||
UpdateDate = ?(UpdateDate = Undefined
|
||||
, OPI_Tools.GetCurrentDate()
|
||||
, UpdateDate);
|
||||
|
||||
OPI_TypeConversion.GetLine(ChannelTitle);
|
||||
OPI_TypeConversion.GetLine(ChannelDescription);
|
||||
OPI_TypeConversion.GetLine(ChannelLink);
|
||||
OPI_TypeConversion.GetArray(Items);
|
||||
OPI_TypeConversion.GetDate(UpdateDate);
|
||||
|
||||
XMLWriter = New XMLWriter;
|
||||
XMLWriter.SetString("UTF-8");
|
||||
|
||||
XMLWriter.WriteXMLDeclaration();
|
||||
XMLWriter.WriteStartElement("rss");
|
||||
XMLWriter.WriteAttribute("version", "2.0");
|
||||
|
||||
XMLWriter.WriteStartElement("channel");
|
||||
WriteXMLItem(XMLWriter, "title" , ChannelTitle);
|
||||
WriteXMLItem(XMLWriter, "link" , ChannelLink);
|
||||
WriteXMLItem(XMLWriter, "description", ChannelDescription);
|
||||
|
||||
DateRFC822 = OPI_Tools.DateRFC822(UpdateDate);
|
||||
WriteXMLItem(XMLWriter, "lastBuildDate", DateRFC822);
|
||||
|
||||
For Each Element In Items Do
|
||||
WriteFeedItem(XMLWriter, Element);
|
||||
EndDo;
|
||||
|
||||
XMLWriter.WriteEndElement();
|
||||
XMLWriter.WriteEndElement();
|
||||
|
||||
Feed = XMLWriter.Close();
|
||||
|
||||
Return Feed;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get feed item structure (RSS)
|
||||
// Gets the structure of parameters for an RSS feed item
|
||||
//
|
||||
// Parameters:
|
||||
// Clear - Boolean - True > structure with empty valuse, False > field descriptions at values - empty
|
||||
// AsMap - Boolean - True > returns fields as map - map
|
||||
//
|
||||
// Returns:
|
||||
// Structure Of KeyAndValue - Feed item fields structure
|
||||
Function GetFeedItemStructureRSS(Val Clear = False, Val AsMap = False) Export
|
||||
|
||||
OPI_TypeConversion.GetBoolean(Clear);
|
||||
OPI_TypeConversion.GetBoolean(AsMap);
|
||||
|
||||
If AsMap Then
|
||||
ElementStructure = New Map;
|
||||
Else
|
||||
ElementStructure = New Structure;
|
||||
EndIf;
|
||||
|
||||
ElementStructure.Insert("title" , "<item title>");
|
||||
ElementStructure.Insert("description" , "<item description/content>");
|
||||
ElementStructure.Insert("link" , "<item URL>");
|
||||
ElementStructure.Insert("pubDate" , "<publication date>");
|
||||
ElementStructure.Insert("author" , "<authors email>");
|
||||
ElementStructure.Insert("guid" , "<unique identifier of the item>");
|
||||
|
||||
If Clear Then
|
||||
ElementStructure = OPI_Tools.ClearCollectionRecursively(ElementStructure);
|
||||
EndIf;
|
||||
|
||||
//@skip-check constructor-function-return-section
|
||||
Return ElementStructure;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Parse feed (RSS)
|
||||
// Parses the XML of an RSS feed and returns a structure with channel data and items
|
||||
//
|
||||
// Parameters:
|
||||
// XMLText - String - XML content of RSS feed - xml
|
||||
//
|
||||
// Returns:
|
||||
// Structure Of KeyAndValue - Channel structure
|
||||
Function ParseFeedRSS(Val XMLText) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(XMLText);
|
||||
|
||||
Channel = New Structure;
|
||||
|
||||
XMLReader = New XMLReader;
|
||||
XMLReader.SetString(XMLText);
|
||||
|
||||
While XMLReader.Read() Do
|
||||
|
||||
If XMLReader.NodeType = XMLNodeType.StartElement Then
|
||||
|
||||
If XMLReader.Name = "channel" Then
|
||||
Channel = ReadChannelRSS(XMLReader);
|
||||
Break;
|
||||
EndIf;
|
||||
|
||||
EndIf;
|
||||
|
||||
EndDo;
|
||||
|
||||
XMLReader.Close();
|
||||
|
||||
Return Channel;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
||||
#Region AtomMethods
|
||||
|
||||
// Create feed (Atom)
|
||||
// Creates the text of an Atom feed
|
||||
//
|
||||
// Parameters:
|
||||
// FeedTitle - String - Feed title - name
|
||||
// FeedLink - String - Feed URL - link
|
||||
// FeedID - String - Feed unique identifier (usually a URL) - id
|
||||
// Items - Array of Structure - Feed items. See GetFeedItemStructureAtom - items
|
||||
// UpdateDate - Date, Undefined - Update date. Current if not filled - date
|
||||
//
|
||||
// Returns:
|
||||
// String - Atom XML feed
|
||||
Function CreateFeedAtom(Val FeedTitle
|
||||
, Val FeedLink
|
||||
, Val FeedID
|
||||
, Val Items
|
||||
, Val UpdateDate = Undefined) Export
|
||||
|
||||
UpdateDate = ?(UpdateDate = Undefined
|
||||
, OPI_Tools.GetCurrentDate()
|
||||
, UpdateDate);
|
||||
|
||||
OPI_TypeConversion.GetLine(FeedTitle);
|
||||
OPI_TypeConversion.GetLine(FeedLink);
|
||||
OPI_TypeConversion.GetLine(FeedID);
|
||||
OPI_TypeConversion.GetArray(Items);
|
||||
OPI_TypeConversion.GetDate(UpdateDate);
|
||||
|
||||
XMLWriter = New XMLWriter;
|
||||
XMLWriter.SetString("UTF-8");
|
||||
|
||||
XMLWriter.WriteXMLDeclaration();
|
||||
XMLWriter.WriteStartElement("feed");
|
||||
XMLWriter.WriteAttribute("xmlns", "http://www.w3.org/2005/Atom");
|
||||
|
||||
WriteXMLItem(XMLWriter, "title", FeedTitle);
|
||||
WriteXMLItem(XMLWriter, "id" , FeedID);
|
||||
|
||||
XMLWriter.WriteStartElement("link");
|
||||
XMLWriter.WriteAttribute("href", FeedLink);
|
||||
XMLWriter.WriteAttribute("rel" , "alternate");
|
||||
XMLWriter.WriteEndElement();
|
||||
|
||||
DateISO8601 = OPI_Tools.DateISO8601(UpdateDate);
|
||||
WriteXMLItem(XMLWriter, "updated", DateISO8601);
|
||||
|
||||
For Each Element In Items Do
|
||||
WriteFeedItemAtom(XMLWriter, Element);
|
||||
EndDo;
|
||||
|
||||
XMLWriter.WriteEndElement(); // feed
|
||||
|
||||
Feed = XMLWriter.Close();
|
||||
|
||||
Return Feed;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get feed item structure (Atom)
|
||||
// Gets the structure of parameters of an Atom feed item
|
||||
//
|
||||
// Parameters:
|
||||
// Clear - Boolean - True > structure with empty valuse, False > field descriptions at values - empty
|
||||
// AsMap - Boolean - True > returns fields as map - map
|
||||
//
|
||||
// Returns:
|
||||
// Structure Of KeyAndValue - Feed item fields structure
|
||||
Function GetFeedItemStructureAtom(Val Clear = False, Val AsMap = False) Export
|
||||
|
||||
OPI_TypeConversion.GetBoolean(Clear);
|
||||
OPI_TypeConversion.GetBoolean(AsMap);
|
||||
|
||||
If AsMap Then
|
||||
ElementStructure = New Map;
|
||||
Else
|
||||
ElementStructure = New Structure;
|
||||
EndIf;
|
||||
|
||||
ElementStructure.Insert("title" , "<item title>");
|
||||
ElementStructure.Insert("id" , "<unique identifier of the item>");
|
||||
ElementStructure.Insert("link" , "<item URL>");
|
||||
ElementStructure.Insert("updated" , "<update date>");
|
||||
ElementStructure.Insert("summary" , "<short description>");
|
||||
ElementStructure.Insert("content" , "<full content>");
|
||||
ElementStructure.Insert("author" , "<author's name>");
|
||||
ElementStructure.Insert("published" , "<publication date>");
|
||||
|
||||
If Clear Then
|
||||
ElementStructure = OPI_Tools.ClearCollectionRecursively(ElementStructure);
|
||||
EndIf;
|
||||
|
||||
//@skip-check constructor-function-return-section
|
||||
Return ElementStructure;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Parse feed (Atom)
|
||||
// Parses the XML of an Atom feed and returns a structure with feed data and items
|
||||
//
|
||||
// Parameters:
|
||||
// XMLText - String - XML content of Atom feed - xml
|
||||
//
|
||||
// Returns:
|
||||
// Structure Of KeyAndValue - Feed structure
|
||||
Function ParseFeedAtom(Val XMLText) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(XMLText);
|
||||
|
||||
Feed = New Structure;
|
||||
|
||||
XMLReader = New XMLReader;
|
||||
XMLReader.SetString(XMLText);
|
||||
|
||||
While XMLReader.Read() Do
|
||||
|
||||
If XMLReader.NodeType = XMLNodeType.StartElement Then
|
||||
|
||||
If XMLReader.Name = "feed" Then
|
||||
Feed = ReadFeedAtom(XMLReader);
|
||||
Break;
|
||||
EndIf;
|
||||
|
||||
EndIf;
|
||||
|
||||
EndDo;
|
||||
|
||||
XMLReader.Close();
|
||||
|
||||
Return Feed;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
|
||||
#Region Private
|
||||
|
||||
Procedure WriteXMLItem(XMLWriter, ElementName, Value)
|
||||
|
||||
If ValueIsFilled(Value) Then
|
||||
XMLWriter.WriteStartElement(ElementName);
|
||||
XMLWriter.WriteText(Value);
|
||||
XMLWriter.WriteEndElement();
|
||||
EndIf;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WriteFeedItem(XMLWriter, Element)
|
||||
|
||||
OPI_TypeConversion.GetKeyValueCollection(Element);
|
||||
|
||||
XMLWriter.WriteStartElement("item");
|
||||
|
||||
For Each DataField In Element Do
|
||||
|
||||
CurrentKey = DataField.Key;
|
||||
CurrentValue = DataField.Value;
|
||||
|
||||
If TypeOf(CurrentValue) = Type("Date") Then
|
||||
CurrentValue = OPI_Tools.DateRFC822(CurrentValue);
|
||||
Else
|
||||
OPI_TypeConversion.GetLine(CurrentValue, False);
|
||||
EndIf;
|
||||
|
||||
If CurrentKey = "guid" Then
|
||||
XMLWriter.WriteStartElement("guid");
|
||||
XMLWriter.WriteAttribute("isPermaLink", "false");
|
||||
XMLWriter.WriteText(CurrentValue);
|
||||
XMLWriter.WriteEndElement();
|
||||
Else
|
||||
WriteXMLItem(XMLWriter, CurrentKey, CurrentValue);
|
||||
EndIf;
|
||||
|
||||
EndDo;
|
||||
|
||||
XMLWriter.WriteEndElement();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Function ReadChannelRSS(XMLReader)
|
||||
|
||||
Channel = New Structure;
|
||||
Items = New Array;
|
||||
|
||||
While XMLReader.Read() Do
|
||||
|
||||
If XMLReader.NodeType = XMLNodeType.StartElement Then
|
||||
|
||||
ElementName = XMLReader.Name;
|
||||
|
||||
If ElementName = "item" Then
|
||||
Element = ReadItemRSS(XMLReader);
|
||||
Items.Add(Element);
|
||||
Else
|
||||
XMLReader.Read();
|
||||
If XMLReader.NodeType = XMLNodeType.Text Then
|
||||
Channel.Insert(ElementName, XMLReader.Value);
|
||||
EndIf;
|
||||
EndIf;
|
||||
|
||||
ElsIf XMLReader.NodeType = XMLNodeType.EndElement And XMLReader.Name = "channel" Then
|
||||
Break;
|
||||
EndIf;
|
||||
|
||||
EndDo;
|
||||
|
||||
Channel.Insert("items", Items);
|
||||
|
||||
Return Channel;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function ReadItemRSS(XMLReader)
|
||||
|
||||
Element = New Structure;
|
||||
|
||||
While XMLReader.Read() Do
|
||||
|
||||
If XMLReader.NodeType = XMLNodeType.StartElement Then
|
||||
|
||||
ElementName = XMLReader.Name;
|
||||
XMLReader.Read();
|
||||
|
||||
If XMLReader.NodeType = XMLNodeType.Text Then
|
||||
Element.Insert(ElementName, XMLReader.Value);
|
||||
EndIf;
|
||||
|
||||
ElsIf XMLReader.NodeType = XMLNodeType.EndElement And XMLReader.Name = "item" Then
|
||||
Break;
|
||||
EndIf;
|
||||
|
||||
EndDo;
|
||||
|
||||
Return Element;
|
||||
|
||||
EndFunction
|
||||
|
||||
Procedure WriteFeedItemAtom(XMLWriter, Element)
|
||||
|
||||
OPI_TypeConversion.GetKeyValueCollection(Element);
|
||||
|
||||
XMLWriter.WriteStartElement("entry");
|
||||
|
||||
For Each DataField In Element Do
|
||||
|
||||
CurrentKey = DataField.Key;
|
||||
CurrentValue = DataField.Value;
|
||||
|
||||
If TypeOf(CurrentValue) = Type("Date") Then
|
||||
CurrentValue = OPI_Tools.DateISO8601(CurrentValue);
|
||||
Else
|
||||
OPI_TypeConversion.GetLine(CurrentValue, False);
|
||||
EndIf;
|
||||
|
||||
If CurrentKey = "link" Then
|
||||
XMLWriter.WriteStartElement("link");
|
||||
XMLWriter.WriteAttribute("href", CurrentValue);
|
||||
XMLWriter.WriteAttribute("rel" , "alternate");
|
||||
XMLWriter.WriteEndElement();
|
||||
ElsIf CurrentKey = "author" Then
|
||||
XMLWriter.WriteStartElement("author");
|
||||
WriteXMLItem(XMLWriter, "name" , CurrentValue);
|
||||
XMLWriter.WriteEndElement();
|
||||
ElsIf CurrentKey = "content" Then
|
||||
XMLWriter.WriteStartElement("content");
|
||||
XMLWriter.WriteAttribute("type", "html");
|
||||
XMLWriter.WriteText(CurrentValue);
|
||||
XMLWriter.WriteEndElement();
|
||||
Else
|
||||
WriteXMLItem(XMLWriter, CurrentKey, CurrentValue);
|
||||
EndIf;
|
||||
|
||||
EndDo;
|
||||
|
||||
XMLWriter.WriteEndElement(); // entry
|
||||
|
||||
EndProcedure
|
||||
|
||||
Function ReadFeedAtom(XMLReader)
|
||||
|
||||
Feed = New Structure;
|
||||
Items = New Array;
|
||||
|
||||
While XMLReader.Read() Do
|
||||
|
||||
If XMLReader.NodeType = XMLNodeType.StartElement Then
|
||||
|
||||
ElementName = XMLReader.Name;
|
||||
|
||||
If ElementName = "entry" Then
|
||||
Element = ReadItemAtom(XMLReader);
|
||||
Items.Add(Element);
|
||||
ElsIf ElementName = "link" Then
|
||||
Feed.Insert("link", XMLReader.GetAttribute("href"));
|
||||
Else
|
||||
XMLReader.Read();
|
||||
If XMLReader.NodeType = XMLNodeType.Text Then
|
||||
Feed.Insert(ElementName, XMLReader.Value);
|
||||
EndIf;
|
||||
EndIf;
|
||||
|
||||
ElsIf XMLReader.NodeType = XMLNodeType.EndElement And XMLReader.Name = "feed" Then
|
||||
Break;
|
||||
EndIf;
|
||||
|
||||
EndDo;
|
||||
|
||||
Feed.Insert("entries", Items);
|
||||
|
||||
Return Feed;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function ReadItemAtom(XMLReader)
|
||||
|
||||
Element = New Structure;
|
||||
|
||||
While XMLReader.Read() Do
|
||||
|
||||
If XMLReader.NodeType = XMLNodeType.StartElement Then
|
||||
|
||||
ElementName = XMLReader.Name;
|
||||
|
||||
If ElementName = "link" Then
|
||||
Element.Insert("link" , XMLReader.GetAttribute("href"));
|
||||
ElsIf ElementName = "author" Then
|
||||
AuthorName = ReadAuthorAtom(XMLReader);
|
||||
Element.Insert("author", AuthorName);
|
||||
Else
|
||||
XMLReader.Read();
|
||||
If XMLReader.NodeType = XMLNodeType.Text Then
|
||||
Element.Insert(ElementName, XMLReader.Value);
|
||||
EndIf;
|
||||
EndIf;
|
||||
|
||||
ElsIf XMLReader.NodeType = XMLNodeType.EndElement And XMLReader.Name = "entry" Then
|
||||
Break;
|
||||
EndIf;
|
||||
|
||||
EndDo;
|
||||
|
||||
Return Element;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function ReadAuthorAtom(XMLReader)
|
||||
|
||||
AuthorName = "";
|
||||
|
||||
While XMLReader.Read() Do
|
||||
|
||||
If XMLReader.NodeType = XMLNodeType.StartElement And XMLReader.Name = "name" Then
|
||||
XMLReader.Read();
|
||||
If XMLReader.NodeType = XMLNodeType.Text Then
|
||||
AuthorName = XMLReader.Value;
|
||||
EndIf;
|
||||
ElsIf XMLReader.NodeType = XMLNodeType.EndElement And XMLReader.Name = "author" Then
|
||||
Break;
|
||||
EndIf;
|
||||
|
||||
EndDo;
|
||||
|
||||
Return AuthorName;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
||||
#Region Alternate
|
||||
|
||||
Function СоздатьФидRSS(Val НазваниеКанала, Val ОписаниеКанала, Val СсылкаКанала, Val Элементы, Val ДатаОбновления = Undefined) Export
|
||||
Return CreateFeedRSS(НазваниеКанала, ОписаниеКанала, СсылкаКанала, Элементы, ДатаОбновления);
|
||||
EndFunction
|
||||
|
||||
Function ПолучитьСтруктуруЭлементаФидаRSS(Val Пустая = False, Val КакСоответствие = False) Export
|
||||
Return GetFeedItemStructureRSS(Пустая, КакСоответствие);
|
||||
EndFunction
|
||||
|
||||
Function РазобратьФидRSS(Val ТекстXML) Export
|
||||
Return ParseFeedRSS(ТекстXML);
|
||||
EndFunction
|
||||
|
||||
Function СоздатьФидAtom(Val НазваниеФида, Val СсылкаФида, Val IDФида, Val Элементы, Val ДатаОбновления = Undefined) Export
|
||||
Return CreateFeedAtom(НазваниеФида, СсылкаФида, IDФида, Элементы, ДатаОбновления);
|
||||
EndFunction
|
||||
|
||||
Function ПолучитьСтруктуруЭлементаФидаAtom(Val Пустая = False, Val КакСоответствие = False) Export
|
||||
Return GetFeedItemStructureAtom(Пустая, КакСоответствие);
|
||||
EndFunction
|
||||
|
||||
Function РазобратьФидAtom(Val ТекстXML) Export
|
||||
Return ParseFeedAtom(ТекстXML);
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
+1
-1
@@ -32,7 +32,7 @@
|
||||
|
||||
Function GetHashSum() Export
|
||||
|
||||
LastBuildHash = "BC910DFB58667D4F2EB594306504DDCA92AED1079A40C2D465C586AED564B673";
|
||||
LastBuildHash = "56083FDD3BA5A392AEAA76F1DB1735E8C1B69114CD8A2E2B7633A303F2AB8990";
|
||||
|
||||
Return LastBuildHash;
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@
|
||||
|
||||
Function GetHashSum() Export
|
||||
|
||||
LastBuildHash = "BC910DFB58667D4F2EB594306504DDCA92AED1079A40C2D465C586AED564B673";
|
||||
LastBuildHash = "56083FDD3BA5A392AEAA76F1DB1735E8C1B69114CD8A2E2B7633A303F2AB8990";
|
||||
|
||||
Return LastBuildHash;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
BC910DFB58667D4F2EB594306504DDCA92AED1079A40C2D465C586AED564B673
|
||||
56083FDD3BA5A392AEAA76F1DB1735E8C1B69114CD8A2E2B7633A303F2AB8990
|
||||
+1
-1
@@ -15,7 +15,6 @@
|
||||
"greenmax": "OPI_GreenMax",
|
||||
"grpc": "OPI_GRPC",
|
||||
"gsheets": "OPI_GoogleSheets",
|
||||
"rss": "OPI_RSS",
|
||||
"metrika": "OPI_YandexMetrika",
|
||||
"mongodb": "OPI_MongoDB",
|
||||
"mssql": "OPI_MSSQL",
|
||||
@@ -27,6 +26,7 @@
|
||||
"postgres": "OPI_PostgreSQL",
|
||||
"rcon": "OPI_RCON",
|
||||
"rportal": "OPI_ReportPortal",
|
||||
"rss": "OPI_RSS",
|
||||
"s3": "OPI_S3",
|
||||
"sftp": "OPI_SFTP",
|
||||
"slack": "OPI_Slack",
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
BC910DFB58667D4F2EB594306504DDCA92AED1079A40C2D465C586AED564B673
|
||||
56083FDD3BA5A392AEAA76F1DB1735E8C1B69114CD8A2E2B7633A303F2AB8990
|
||||
Vendored
+1
-1
@@ -22,7 +22,7 @@
|
||||
<module name="OPI_PostgreSQL" file="postgres/Modules/OPI_PostgreSQL.os"/>
|
||||
<module name="OPI_RCON" file="rcon/Modules/OPI_RCON.os"/>
|
||||
<module name="OPI_ReportPortal" file="rportal/Modules/OPI_ReportPortal.os"/>
|
||||
<module name="OPI_RSS" file="metrika/Modules/OPI_RSS.os"/>
|
||||
<module name="OPI_RSS" file="rss/Modules/OPI_RSS.os"/>
|
||||
<module name="OPI_S3" file="s3/Modules/OPI_S3.os"/>
|
||||
<module name="OPI_SFTP" file="sftp/Modules/OPI_SFTP.os"/>
|
||||
<module name="OPI_Slack" file="slack/Modules/OPI_Slack.os"/>
|
||||
|
||||
+464
-535
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -32,7 +32,7 @@
|
||||
|
||||
Function GetHashSum() Export
|
||||
|
||||
LastBuildHash = "BC910DFB58667D4F2EB594306504DDCA92AED1079A40C2D465C586AED564B673";
|
||||
LastBuildHash = "56083FDD3BA5A392AEAA76F1DB1735E8C1B69114CD8A2E2B7633A303F2AB8990";
|
||||
|
||||
Return LastBuildHash;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
Function GetHashSum() Export
|
||||
|
||||
LastBuildHash = "BC910DFB58667D4F2EB594306504DDCA92AED1079A40C2D465C586AED564B673";
|
||||
LastBuildHash = "56083FDD3BA5A392AEAA76F1DB1735E8C1B69114CD8A2E2B7633A303F2AB8990";
|
||||
|
||||
Return LastBuildHash;
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
BC910DFB58667D4F2EB594306504DDCA92AED1079A40C2D465C586AED564B673
|
||||
56083FDD3BA5A392AEAA76F1DB1735E8C1B69114CD8A2E2B7633A303F2AB8990
|
||||
@@ -15,7 +15,6 @@
|
||||
"greenmax": "OPI_GreenMax",
|
||||
"grpc": "OPI_GRPC",
|
||||
"gsheets": "OPI_GoogleSheets",
|
||||
"rss": "OPI_RSS",
|
||||
"metrika": "OPI_YandexMetrika",
|
||||
"mongodb": "OPI_MongoDB",
|
||||
"mssql": "OPI_MSSQL",
|
||||
@@ -27,6 +26,7 @@
|
||||
"postgres": "OPI_PostgreSQL",
|
||||
"rcon": "OPI_RCON",
|
||||
"rportal": "OPI_ReportPortal",
|
||||
"rss": "OPI_RSS",
|
||||
"s3": "OPI_S3",
|
||||
"sftp": "OPI_SFTP",
|
||||
"slack": "OPI_Slack",
|
||||
|
||||
Reference in New Issue
Block a user