I sent theta to tether on celsius wallet, Wrong wallet! how can I get it back?
This wallet is my own. I check the transaction ID and it shows that the transfer was successful. What should I do?
New and Fresh Private + Public Proxies Lists Everyday!
Get and Download New Proxies from NewProxyLists.com
I sent theta to tether on celsius wallet, Wrong wallet! how can I get it back?
This wallet is my own. I check the transaction ID and it shows that the transfer was successful. What should I do?
I have changed the time zone of my WordPress blog because I have relocated. After that, all times shown on the blog are wrong.
For example, my post was published at 2021-04-22 00:22 +0800 (Hong Kong Time). I have configured the time format on my blog to include the time zone. However I have relocated to the UK so that I changed the time zone of my blog to London. Now, the time is showing at 2021-04-22 00:22 +0100 which is obviously wrong.
How can I fix it such that it can show correctly as 2021-04-21 17:22 +0100?
I have a problem with getting Nginx proxy to work with Mautic instance, the website works like that(I swapped all urls to https://mautic.example
):
When you visit https://mautic.example
, you get redirected to /s/login
. After logging in, browsers sends POST to /s/login_check, gets 302 found and location header, then browser sends GET to location header URL.
In original server the location header is https://mautic.example/s/dashboard
. On proxy it’s /s/login
which does nothing else but refreshes the page because the user is already on /s/login
.
I want simplest proxy possible.
Here is configuration I tried:
server {
listen 8091;
location / {
proxy_pass https://mautic.example;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
What am I missing here?
I build JAVA EE project and choose glassfish as a server and mysql as a database,
when i trying integrate mysql database in glassfish server, there are some errors :
I fill properties database like name , server , PortNumber .. etc.
when I test connection by press on ping button , this message displayed
An error has occurred Ping Connection Pool failed for DemoDatabase.
Class name is wrong or classpath is not set for : com.mysql.cj.jdbc.Driver
Please check the server.log for more details. An error has occurred
Ping Connection Pool failed for DemoDatabase.
Class name is wrong or classpath is not set for : com.mysql.cj.jdbc.Driver Please check the server.log for more details.
this message in Server.log
Cannot find poolName in ping-connection-pool command model, file a bugninjection failed on org.glassfish.connectors.admin.cli.PingConnectionPool.poolName with class java.lang.String
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
Asked
Viewed
5 times
We are getting “Sorry, something went wrong. You can find out more in the error log.” error when searching in the search bar.
1 exception(s): Exception #0 (MagentoFrameworkExceptionLocalizedException): Sorry, something went wrong. You can find out more in the error log.> Exception #0 (MagentoFrameworkExceptionLocalizedException): Sorry, something went wrong. You can find out more in the error log. <pre>#1 MagentoFrameworkDataCollectionAbstractDb->_renderFilters() called at (app/code/Mageplaza/LayeredNavigation/Model/ResourceModel/Fulltext/Collection.php:408)
#2 MageplazaLayeredNavigationModelResourceModelFulltextCollection->_renderFilters() called at (vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:1167)
#3 MagentoCatalogModelResourceModelProductCollection->_getSelectCountSql() called at (vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:1155)
#4 MagentoCatalogModelResourceModelProductCollection->getSelectCountSql() called at (vendor/magento/framework/Data/Collection/AbstractDb.php:221)
#5 MagentoFrameworkDataCollectionAbstractDb->getSize() called at (vendor/magento/framework/Interception/Interceptor.php:58)
#6 MageplazaLayeredNavigationModelResourceModelFulltextCollectionInterceptor->___callParent() called at (vendor/magento/framework/Interception/Interceptor.php:138)
#7 MageplazaLayeredNavigationModelResourceModelFulltextCollectionInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/framework/Interception/Interceptor.php:153)
#8 MageplazaLayeredNavigationModelResourceModelFulltextCollectionInterceptor->___callPlugins() called at (generated/code/Mageplaza/LayeredNavigation/Model/ResourceModel/Fulltext/Collection/Interceptor.php:52)
#9 MageplazaLayeredNavigationModelResourceModelFulltextCollectionInterceptor->getSize() called at (app/code/Mirasvit/Search/view/frontend/templates/result.phtml:15)
#10 include() called at (vendor/magento/framework/View/TemplateEngine/Php.php:59)
#11 MagentoFrameworkViewTemplateEnginePhp->render() called at (vendor/magento/framework/View/Element/Template.php:271)
#12 MagentoFrameworkViewElementTemplate->fetchView() called at (vendor/magento/framework/View/Element/Template.php:301)
#13 MagentoFrameworkViewElementTemplate->_toHtml() called at (vendor/magento/framework/View/Element/AbstractBlock.php:1097)
#14 MagentoFrameworkViewElementAbstractBlock->MagentoFrameworkViewElement{closure}() called at (vendor/magento/framework/View/Element/AbstractBlock.php:1101)
#15 MagentoFrameworkViewElementAbstractBlock->_loadCache() called at (vendor/magento/framework/View/Element/AbstractBlock.php:671)
#16 MagentoFrameworkViewElementAbstractBlock->toHtml() called at (vendor/magento/framework/Interception/Interceptor.php:58)
#17 MirasvitSearchBlockResultInterceptor->___callParent() called at (vendor/magento/framework/Interception/Interceptor.php:138)
#18 MirasvitSearchBlockResultInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/framework/Interception/Interceptor.php:153)
#19 MirasvitSearchBlockResultInterceptor->___callPlugins() called at (generated/code/Mirasvit/Search/Block/Result/Interceptor.php:26)
#20 MirasvitSearchBlockResultInterceptor->toHtml() called at (app/code/Mirasvit/Search/view/frontend/templates/result_filter.phtml:2)
#21 include() called at (vendor/magento/framework/View/TemplateEngine/Php.php:59)
#22 MagentoFrameworkViewTemplateEnginePhp->render() called at (vendor/magento/framework/View/Element/Template.php:271)
#23 MagentoFrameworkViewElementTemplate->fetchView() called at (vendor/magento/framework/View/Element/Template.php:301)
#24 MagentoFrameworkViewElementTemplate->_toHtml() called at (vendor/magento/framework/View/Element/AbstractBlock.php:1097)
#25 MagentoFrameworkViewElementAbstractBlock->MagentoFrameworkViewElement{closure}() called at (vendor/magento/framework/View/Element/AbstractBlock.php:1101)
#26 MagentoFrameworkViewElementAbstractBlock->_loadCache() called at (vendor/magento/framework/View/Element/AbstractBlock.php:671)
#27 MagentoFrameworkViewElementAbstractBlock->toHtml() called at (vendor/magento/framework/Interception/Interceptor.php:58)
#28 MirasvitSearchBlockResultInterceptor->___callParent() called at (vendor/magento/framework/Interception/Interceptor.php:138)
#29 MirasvitSearchBlockResultInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/framework/Interception/Interceptor.php:153)
#30 MirasvitSearchBlockResultInterceptor->___callPlugins() called at (generated/code/Mirasvit/Search/Block/Result/Interceptor.php:26)
#31 MirasvitSearchBlockResultInterceptor->toHtml() called at (vendor/magento/framework/View/Layout.php:557)
#32 MagentoFrameworkViewLayout->_renderBlock() called at (vendor/magento/framework/View/Layout.php:533)
#33 MagentoFrameworkViewLayout->renderNonCachedElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:206)
#34 MagentoFrameworkViewLayoutInterceptor->renderNonCachedElement() called at (vendor/magento/framework/View/Layout.php:488)
#35 MagentoFrameworkViewLayout->renderElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:193)
#36 MagentoFrameworkViewLayoutInterceptor->renderElement() called at (vendor/magento/framework/View/Layout.php:585)
#37 MagentoFrameworkViewLayout->_renderContainer() called at (vendor/magento/framework/View/Layout.php:535)
#38 MagentoFrameworkViewLayout->renderNonCachedElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:206)
#39 MagentoFrameworkViewLayoutInterceptor->renderNonCachedElement() called at (vendor/magento/framework/View/Layout.php:488)
#40 MagentoFrameworkViewLayout->renderElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:193)
#41 MagentoFrameworkViewLayoutInterceptor->renderElement() called at (vendor/magento/framework/View/Layout.php:585)
#42 MagentoFrameworkViewLayout->_renderContainer() called at (vendor/magento/framework/View/Layout.php:535)
#43 MagentoFrameworkViewLayout->renderNonCachedElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:206)
#44 MagentoFrameworkViewLayoutInterceptor->renderNonCachedElement() called at (vendor/magento/framework/View/Layout.php:488)
#45 MagentoFrameworkViewLayout->renderElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:193)
#46 MagentoFrameworkViewLayoutInterceptor->renderElement() called at (vendor/magento/framework/View/Layout.php:585)
#47 MagentoFrameworkViewLayout->_renderContainer() called at (vendor/magento/framework/View/Layout.php:535)
#48 MagentoFrameworkViewLayout->renderNonCachedElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:206)
#49 MagentoFrameworkViewLayoutInterceptor->renderNonCachedElement() called at (vendor/magento/framework/View/Layout.php:488)
#50 MagentoFrameworkViewLayout->renderElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:193)
#51 MagentoFrameworkViewLayoutInterceptor->renderElement() called at (vendor/magento/framework/View/Layout.php:585)
#52 MagentoFrameworkViewLayout->_renderContainer() called at (vendor/magento/framework/View/Layout.php:535)
#53 MagentoFrameworkViewLayout->renderNonCachedElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:206)
#54 MagentoFrameworkViewLayoutInterceptor->renderNonCachedElement() called at (vendor/magento/framework/View/Layout.php:488)
#55 MagentoFrameworkViewLayout->renderElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:193)
#56 MagentoFrameworkViewLayoutInterceptor->renderElement() called at (vendor/magento/framework/View/Layout.php:585)
#57 MagentoFrameworkViewLayout->_renderContainer() called at (vendor/magento/framework/View/Layout.php:535)
#58 MagentoFrameworkViewLayout->renderNonCachedElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:206)
#59 MagentoFrameworkViewLayoutInterceptor->renderNonCachedElement() called at (vendor/magento/framework/View/Layout.php:488)
#60 MagentoFrameworkViewLayout->renderElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:193)
#61 MagentoFrameworkViewLayoutInterceptor->renderElement() called at (vendor/magento/framework/View/Layout.php:585)
#62 MagentoFrameworkViewLayout->_renderContainer() called at (vendor/magento/framework/View/Layout.php:535)
#63 MagentoFrameworkViewLayout->renderNonCachedElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:206)
#64 MagentoFrameworkViewLayoutInterceptor->renderNonCachedElement() called at (vendor/magento/framework/View/Layout.php:488)
#65 MagentoFrameworkViewLayout->renderElement() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:193)
#66 MagentoFrameworkViewLayoutInterceptor->renderElement() called at (vendor/magento/framework/View/Layout.php:954)
#67 MagentoFrameworkViewLayout->getOutput() called at (vendor/magento/framework/Interception/Interceptor.php:58)
#68 MagentoFrameworkViewLayoutInterceptor->___callParent() called at (vendor/magento/framework/Interception/Interceptor.php:138)
#69 MagentoFrameworkViewLayoutInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/framework/Interception/Interceptor.php:153)
#70 MagentoFrameworkViewLayoutInterceptor->___callPlugins() called at (generated/code/Magento/Framework/View/Layout/Interceptor.php:494)
#71 MagentoFrameworkViewLayoutInterceptor->getOutput() called at (vendor/magento/framework/View/Result/Page.php:258)
#72 MagentoFrameworkViewResultPage->render() called at (vendor/magento/framework/View/Result/Layout.php:171)
#73 MagentoFrameworkViewResultLayout->renderResult() called at (vendor/magento/framework/Interception/Interceptor.php:58)
#74 MagentoFrameworkViewResultPageInterceptor->___callParent() called at (vendor/magento/framework/Interception/Interceptor.php:138)
#75 MagentoFrameworkViewResultPageInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/framework/Interception/Interceptor.php:153)
#76 MagentoFrameworkViewResultPageInterceptor->___callPlugins() called at (generated/code/Magento/Framework/View/Result/Page/Interceptor.php:130)
#77 MagentoFrameworkViewResultPageInterceptor->renderResult() called at (vendor/magento/framework/App/View.php:221)
#78 MagentoFrameworkAppView->renderLayout() called at (app/code/Mageplaza/AjaxLayer/Controller/Search/Result/Index.php:149)
#79 MageplazaAjaxLayerControllerSearchResultIndex->execute() called at (vendor/magento/framework/App/Action/Action.php:108)
#80 MagentoFrameworkAppActionAction->dispatch() called at (vendor/magento/framework/Interception/Interceptor.php:58)
#81 MageplazaAjaxLayerControllerSearchResultIndexInterceptor->___callParent() called at (vendor/magento/framework/Interception/Interceptor.php:138)
#82 MageplazaAjaxLayerControllerSearchResultIndexInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/framework/Interception/Interceptor.php:153)
#83 MageplazaAjaxLayerControllerSearchResultIndexInterceptor->___callPlugins() called at (generated/code/Mageplaza/AjaxLayer/Controller/Search/Result/Index/Interceptor.php:26)
#84 MageplazaAjaxLayerControllerSearchResultIndexInterceptor->dispatch() called at (vendor/magento/framework/App/FrontController.php:159)
#85 MagentoFrameworkAppFrontController->processRequest() called at (vendor/magento/framework/App/FrontController.php:99)
#86 MagentoFrameworkAppFrontController->dispatch() called at (vendor/magento/framework/Interception/Interceptor.php:58)
#87 MagentoFrameworkAppFrontControllerInterceptor->___callParent() called at (vendor/magento/framework/Interception/Interceptor.php:138)
#88 MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:94)
#89 MagentoStoreAppFrontControllerPluginRequestPreprocessor->aroundDispatch() called at (vendor/magento/framework/Interception/Interceptor.php:135)
#90 MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}() called at (app/code/Mirasvit/CacheWarmer/Plugin/Debug/OnHitPlugin.php:147)
#91 MirasvitCacheWarmerPluginDebugOnHitPlugin->aroundAroundDispatch() called at (vendor/magento/framework/Interception/Interceptor.php:135)
#92 MagentoPageCacheModelAppFrontControllerBuiltinPluginInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/framework/Interception/Interceptor.php:153)
#93 MagentoPageCacheModelAppFrontControllerBuiltinPluginInterceptor->___callPlugins() called at (generated/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin/Interceptor.php:26)
#94 MagentoPageCacheModelAppFrontControllerBuiltinPluginInterceptor->aroundDispatch() called at (vendor/magento/framework/Interception/Interceptor.php:135)
#95 MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}() called at (vendor/magento/framework/Interception/Interceptor.php:153)
#96 MagentoFrameworkAppFrontControllerInterceptor->___callPlugins() called at (generated/code/Magento/Framework/App/FrontController/Interceptor.php:26)
#97 MagentoFrameworkAppFrontControllerInterceptor->dispatch() called at (vendor/magento/framework/App/Http.php:137)
#98 MagentoFrameworkAppHttp->launch() called at (generated/code/Magento/Framework/App/Http/Interceptor.php:24)
#99 MagentoFrameworkAppHttpInterceptor->launch() called at (vendor/magento/framework/App/Bootstrap.php:261)
#100 MagentoFrameworkAppBootstrap->run() called at (index.php:39) </pre>
This error is getting in the production environment.
Can you please help on this?
default
In my Windows start menu, I have several Chrome shortcuts (Gmail, Outlook, Teams, OneDrive, To Do). They all have the same background, except To Do. How can I make To Do also have a light background?
What I have tried/checked so far:
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
Asked
Viewed
4 times
import java.io.*;
import java.util.*;
public class reverseAnArray2
{
public static void main(String args())throws IOException
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter size");
int n = sc.nextInt();
int a () = new int (n) ;
int b () = new int (n) ;
System.out.println("Enter elements");
for(int i=0;i<n;i++)
{
a(i)=sc.nextInt() ;
}
int size = n;
System.out.println("Reverse array is : ");
int p=0;
while(n>=0 && p<n)
{
a(--n) = a(p) ;
++p;
}
for(int i =0;i<size;i++)
{
System.out.println(+ a(i));
}
}
}
The output comes correct but only up to the last $n/2$ terms, rest of it gets repeated. The output was correct when I used another fresh array to store data. But that’s not an optimal code. I want to reverse it without using another array.
Shakeeb Shahid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
I installed the cdn module from:
https://www.drupal.org/project/cdn
and in the UI i setted a wrong cdn path.
now my site is broken it can load css and js. end i cannot disable the module from the UI.
i have admin access at the server but i cant figure out how to disable cdn, there is a cdn,settings.yml but it seems that the option isnt there.
i cant find any documentation for the module… can you please help me?
/*!
* RSS Marquee
*
* Licensed under MIT
* Copyright (c) 2020 (Samuel Carreira)
*/
class RSSMarquee {
/**
*
* @param {string()} feedURLs Feed URLs
* @param {object} elementContainer the selector of the marquee container
* @param {number} options.speed duration in ms per character. Bigger values = slow speed
* @param {number} options.maxItems specify max number of titles to show (useful to debug)
* @param {object} options.hostnameSelector The selector of the element where you want to show the URL of the news feed source (usefull for copyright atttribution)
*/
constructor(feedURLs, elementContainer, options = { speed: 110, maxItems: null, hostnameSelector: null }) {
this._feedURLs = new Array();
if (Array.isArray(feedURLs)) {
this._feedURLs = feedURLs;
} else {
this._feedURLs(0) = feedURLs;
}
const URLvalidation = this._feedURLs.every(this.validateURL);
if (!URLvalidation) {
throw new TypeError(‘Invalid URL on list’);
}
this._urlIndex = 0;
this._anim = null;
this._newsText = ”;
this._lastTime = Date.now();
if (elementContainer === null) {
throw new TypeError(‘Invalid element selector’);
}
this._elementContainer = elementContainer;
this.styleElementContainer();
this._options = {
speed: this.validateSpeed(options.speed),
maxItems: options.maxItems,
hostnameSelector: options.hostnameSelector,
// …options
};
this.getRSS();
}
validateSpeed(speed) {
if (!Number(speed) || speed < 50 || speed > 300) {
return 110; // default safe value
} else {
return speed;
}
}
/**
* Set the animation speed
* @param {number} speed value between 50-300
*/
set setSpeed(speed) {
this._options.speed = this.validateSpeed(speed);
}
get getSpeed() {
return this._options.speed;
}
/**
* Validate URL (uses URL interface)
*
* @param {string} url Url to check
* @returns {boolean} true if valid
*/
validateURL(url) {
try {
const u = new URL(url);
return true;
} catch (e) {
return false;
}
}
/**
* Get Hostname from url string
*
* Sample: “https://www.dnoticias.pt/rss/desporto.xml”
* returns url
*
* @param {string} url url string
* @returns {string} hostname
*/
getHostname(url) {
try {
const u = new URL(url);
return u.hostname;
} catch (e) {
return ”;
}
}
getRSS() {
const url = this._feedURLs(this._urlIndex);
this.fetchRSS(url)
.then((xmlText) => {
this._newsText = this.parseXMLFeed(xmlText);
this.showMarquee(this._newsText);
this.showHostname(url);
})
.catch((err) => {
console.error(err);
this.handleErrors();
});
}
handleErrors() {
const diffTime = Date.now() – this._lastTime;
if (diffTime > 5000) {
console.log(‘Trying next feed URL…’);
this.nextURL();
this._lastTime = Date.now();
} else {
if (this._newsText === ”) {
console.log(‘delay…’);
setTimeout(() => {
this.nextURL();
}, 5000);
} else {
console.log(‘show again cached saved news’);
this.showMarquee(this._newsText);
}
}
}
nextURL() {
this.increaseIndex();
this.getRSS();
}
styleElementContainer() {
this._elementContainer.style.overflow = ‘hidden’;
this._elementContainer.style.whiteSpace = ‘nowrap’;
}
showHostname(url) {
if (!this._options.hostnameSelector) {
return;
}
this._options.hostnameSelector.innerText = this.getHostname(url);
}
showMarquee(aCollection) {
try {
const animKeyframes = ({
transform: ‘translateX(0)’
},
{
transform: ‘translateX(-100%)’
}
);
const animOptions = {
duration: 25000, // The number of milliseconds each iteration of the animation takes to complete. Defaults to 0. Although this is technically optional, keep in mind that your animation will not run if this value is 0.
easing: ‘linear’, // The rate of the animation’s change over time. Accepts the pre-defined values “linear”, “ease”, “ease-in”, “ease-out”, and “ease-in-out”, or a custom “cubic-bezier” value like “cubic-bezier(0.42, 0, 0.58, 1)”. Defaults to “linear”.
iterations: 1, // The number of times the animation should repeat. Defaults to 1, and can also take a value of Infinity to make it repeat for as long as the element exists.
delay: 0, // The number of milliseconds to delay the start of the animation. Defaults to 0.
endDelay: 0 // The number of milliseconds to delay after the end of an animation. This is primarily of use when sequencing animations based on the end time of another animation. Defaults to 0.
};
animOptions.duration = aCollection.length * this._options.speed;
const elementChildNode = document.createElement(‘span’);
elementChildNode.style.display = ‘inline-block’;
elementChildNode.style.paddingLeft = ‘100%’;
//const textNode = document.createTextNode(text);
console.log(aCollection.lenght);
aCollection.forEach(function(item, index, array) {
elementChildNode.appendChild(item)
})
console.log(“totale:”);
console.log(elementChildNode);
//elementChildNode.appendChild(textNode);
//this._elementContainer.appendChild(elementChildNode);
this._anim = elementChildNode.animate(animKeyframes, animOptions);
console.log(‘start animation’);
this._anim.onfinish = () => {
console.log(‘end’);
while (this._elementContainer.firstChild) {
this._elementContainer.firstChild.remove();
}
delete this._anim.onfinish;
this.nextURL();
};
this._lastTime = Date.now();
} catch (err) {
console.error(err);
}
}
increaseIndex() {
this._urlIndex += 1;
if (this._urlIndex > this._feedURLs.length – 1) {
this._urlIndex = 0;
}
}
/**
* Fetch RSS
* @param {string} feedURL RSS XML url
*/
fetchRSS(feedURL) {
return new Promise((resolve, reject) => {
console.info(`Start fetching ${feedURL}…`);
fetch(feedURL, { mode: ‘cors’, redirect: ‘follow’ })
.then((response) => {
return response.text();
})
.then((xmlTxt) => {
return resolve(xmlTxt);
})
.catch(() => {
console.error(‘Error in fetching the RSS feed’);
reject();
})
});
}
/**
* Parses RSS XML feed
*
* – Select title elementContainer
* – add dot separator between “headlines”
* – remove <!(CDATA( string
* – remove html tags
*
* @param {string} xmlText
* @returns {string} parsed feed
*/
parseXMLFeed(xmlText) {
try {
const parser = new DOMParser();
const doc = parser.parseFromString(xmlText, “text/xml”);
let news = ”;
let aCollection=();
let totals = 0;
for (let item of doc.querySelectorAll(‘item’)) {
let title = item.getElementsByTagName(“title”)(0).childNodes(0).nodeValue;
// let description = item.getElementsByTagName(“description”)(0).childNodes(0).nodeValue;
let link = item.getElementsByTagName(“link”)(0).childNodes(0).nodeValue;
if (title) {
if (news.length) {
news += ‘xa0’ + ‘ • ‘ + ‘xa0’;
}
title = this.remoteCData(title);
title = this.stripTags(title);
news += title;
var a = document.createElement(‘a’);
var linkText = document.createTextNode(title);
a.appendChild(linkText);
a.title = title;
a.href = link;
aCollection.push(a);
totals += 1;
}
if (this._options.maxItems !== null && totals >= this._options.maxItems) {
console.info(‘Maximum items reached!’);
break;
}
}
//console.log(aCollection);
//console.log(news);
console.info(`Parsed ${totals} title(s)`);
return aCollection;
} catch (err) {
console.error(err);
return ‘ ‘;
}
}
stripTags(textWithTags) {
return textWithTags.replace(/<(.|n)*?>/g, ”);
}
remoteCData(originalText) {
return originalText.replace(“<!(CDATA(“, “”).replace(“))>”, “”);
}
}
The non occurring animation is in function: showMarquee(aCollection). The original site shows how to test it.
Thanks,