{"id":54,"date":"2021-02-02T10:54:24","date_gmt":"2021-02-02T16:54:24","guid":{"rendered":"https:\/\/nowloop.com\/chicago-il\/?page_id=54"},"modified":"2021-02-02T10:54:30","modified_gmt":"2021-02-02T16:54:30","slug":"rss-display-scrolling-marquee-abdelilah930-delivered-jan-29-743-pm","status":"publish","type":"page","link":"https:\/\/nowloop.com\/chicago-il\/rss-display-scrolling-marquee-abdelilah930-delivered-jan-29-743-pm\/","title":{"rendered":"RSS Display SCROLLING MARQUEE Abdelilah930 delivered Jan 29, 7:43 PM"},"content":{"rendered":"<hr>\n\n\n<script src=\"\/\/code.jquery.com\/jquery-1.12.4.min.js\"><\/script>\n            <script src=\"https:\/\/www.jqueryscript.net\/demo\/jQuery-Plugin-For-Horizontal-Text-Scrolling-Simple-Marquee\/marquee.js\"><\/script>\n            \n<style>\n            .mitem{\n                display: inline-flex;\n                text-decoration: none;\n                color: black\n            }\n            .mitem-div{\n                height: 50px;\n                margin-top: 20px;\n            }\n            .mitem-div2{\n                width: 600px;\n                word-wrap: break-word;\n                margin-left: 10px;\n            }\n            .mitem-title{\n                width: 600px;\n                word-wrap: break-word;\n                white-space: break-spaces;\n\n            }\n            .mitem-description{\n                width: 600px;\n                word-wrap: break-word;\n                white-space: break-spaces;\n            }\n        <\/style>\n        <style>\n                .container {\n  width: 100%;\n  height: 400px;\n  float: left;\n  display: inline-block;\n  overflow: hidden;\n  box-sizing: border-box;\n  position: relative;\n  cursor: pointer;\n}\n\n.marquee-sibling {\n  padding: 0;\n  width: 20%;\n  height: 45px;\n  line-height: 42px;\n  font-size: 12px;\n  font-weight: normal;\n  text-align: center;\n  float: left;\n  left: 0;\n  z-index: 2000;\n}\n\n.marquee,\n*[class^=\"marquee\"] {\n  display: inline-block;\n  white-space: nowrap;\n  position: absolute;\n}\n\n.marquee { margin-left: 25%; }\n\n.marquee-content-items {\n  display: inline-block;\n  padding: 5px;\n  margin: 0;\n  \/*height: 45px;*\/\n  position: relative;\n}\n\n.marquee-content-items li {\n  display: inline-block;\n  color: #fff;\n}\n\n.marquee-content-items li:after {\n  margin: 0 1em;\n}\n\n            <\/style>\n        <div class=\"container\">\n            <div class=\"marquee\">\n                <ul class=\"marquee-content-items\" id=\"mar-items\">\n                    \n                <\/ul>\n            <\/div>\n        <\/div>\n        <script>\n                function init(){\n                        createMarquee({duration: 300000});\n                }\n\n\n            <\/script>\n<script src=\"https:\/\/momentjs.com\/downloads\/moment.min.js\"><\/script>\n            <script>\n                const urls = [\"https:\/\/www.unilad.co.uk\/feed\/\"];\n                const maindiv = document.getElementById(\"mar-items\");\n                \/\/let divHeight = 900; \/* change the height of the container here *\/\n                \/\/maindiv.style.height = divHeight.toString() + \"px\";\n                let limitPerFeed = 5; \/* if the value is 0 it means there no limit of outputs*\/\n                let titleSize = \"1.5\"; \/* change the size of the title *\/\n                let titleColor = \"black\"; \/* change the color of the title *\/\n                let descriptionSize = \"1\"; \/* change the size of the description *\/\n                let descriptionColor = \"#4f4e4c\"; \/* change the color of the description *\/\n                let pubdateSize = \"1\"; \/* change the size of the publication date *\/\n                let pudateColor = \"black\"; \/* change the color of the publication date *\/\n                let thumbnailHeight = \"150\"; \/* in pixel example: $thumbnailHeight = \"150\";*\/\n                let thumbnailWidth = \"200\"; \/* in pixel example: $thumbnailWidth = \"150\";*\/\n                let descriptionLength = 200; \/* the length of the descrition(how many characters?) *\/\n                let titleLength = 200; \/* the length of the title(how many characters?) *\/\n                function getThumbnail(text) {\n                    let tag = \"\";\n                    let src = \"\";\n                    let b = false;\n                    for(let i = 0; i < text.length; i++) {\n                        if (text[i] === \"<\"){\n                            if(text[i+1] === \"i\"){\n                                if(text[i+2] === \"m\"){\n                                    if(text[i+3] === \"g\"){\n                                        b = true;\n                                    }\n                                }   \n                            }\n                        }\n                        if(b) {\n                            tag = tag + text[i];\n                            if(text[i] === \">\"){\n                                break;\n                            }\n                        }\n                    }\n                    b = false;\n                    for(i = 0; i < tag.length; i++) {\n                        if (tag[i-5] === \"s\"){\n                            if(tag[i-4] === \"r\"){\n                                if(tag[i-3] === \"c\"){\n                                    if(tag[i-2] === \"=\"){\n                                        if(tag[i-1] === '\"'){\n                                            b = true;\n                                        }\n                                    }\n                                }\n                            }\n                            \n                        }\n                        if(b) {\n                            if(tag[i] === '\"'){\n                                break;\n                            }\n                            src = src + tag[i];\n                        }\n                    }\n                    return src;\n                }\n                \n            for(let url of urls){\n            fetch(url)\n                    .then(response => response.text())\n                    .then(str => new window.DOMParser().parseFromString(str, \"text\/xml\"))\n                    .then(data => {\n                        let items = [];\n                let its = data.querySelectorAll(\"item\");\n                for(let it of its){\n                    items.push(it);\n                }\n                        (limitPerFeed === 0 ? items : items.slice(0, limitPerFeed)).forEach(item => {\n                            let elem = document.createElement(\"li\");\n                            let link = item.querySelector(\"link\").textContent;\n                            let title = item.querySelector(\"title\").textContent;\n                            let description = item.querySelector(\"description\").textContent.toString().replace(\/(<([^>]+)>)\/gi, \"\");\n                            let pubdate = item.querySelector(\"pubDate\").innerHTML;\n                            let de = item.getElementsByTagNameNS(\"*\", \"encoded\");\n                            let me = item.getElementsByTagNameNS(\"*\", \"content\");\n                            let thumbnail;\n                            if(me.length > 0){\n                                thumbnail = me.item(0).attributes.url.textContent;\n                            }else{\n                                if(de.length < 1){\n                                    thumbnail = getThumbnail(item.querySelector(\"description\").textContent);\n                                }else{\n                                    thumbnail = getThumbnail(de.item(0).innerHTML.toString());\n                                }\n                            }\n                            \n                            let ht = '<a href=\"'+link+'\" target=\"_blank\">'+\n                                        '<div class=\"mitem\">'+\n                                            '<div class=\"mitem-div\"><img decoding=\"async\" style=\"height: ' + thumbnailHeight + 'px; width: ' + thumbnailWidth + 'px\" src=\"' + thumbnail + '\" alt=\"[thumbnail]\" \/><\/div>'+\n                                            '<div class=\"mitem-div2\">'+\n                                                '<div class=\"mitem-title\"><h2>' + (title.length > titleLength ? title.substring(0, titleLength) + \"...\" : title)  + '<\/h2><\/div>'+\n                                                '<div class=\"mitem-description\">' + (description.length > descriptionLength ? description.substring(0, descriptionLength) + \"...\" : description) + '<\/div>'+\n                                                '<div>' + (moment(pubdate).fromNow()) + '<\/div>'+\n                                            '<\/div>'+\n                                        '<\/div>'+\n                                    '<\/a>';\n                            elem.innerHTML = ht;\n                            elem.style.width=\"650px;\";\n                            maindiv.appendChild(elem);\n                        })\n                    }).then(() => {init();})\n            }\n            <\/script>\n\n\n<hr>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"class_list":["post-54","page","type-page","status-publish","entry"],"_links":{"self":[{"href":"https:\/\/nowloop.com\/chicago-il\/wp-json\/wp\/v2\/pages\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nowloop.com\/chicago-il\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/nowloop.com\/chicago-il\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/nowloop.com\/chicago-il\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nowloop.com\/chicago-il\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":1,"href":"https:\/\/nowloop.com\/chicago-il\/wp-json\/wp\/v2\/pages\/54\/revisions"}],"predecessor-version":[{"id":55,"href":"https:\/\/nowloop.com\/chicago-il\/wp-json\/wp\/v2\/pages\/54\/revisions\/55"}],"wp:attachment":[{"href":"https:\/\/nowloop.com\/chicago-il\/wp-json\/wp\/v2\/media?parent=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}