How to retrieve status of a livestream from an xml file - javascript

I am in the process of making a website on Dreamweaver CC. On one of the pages, I want there to be a section where the page tells you a streamer's name (from livestream) and right next to it, their status of whether they are live or not.
Livestream's api provides a link that retrieves the status in the form of an .xml file. ex. xkainlessx.api.channel.livestream.com/2.0/livestatus.xml. The name of the streamer is in this format: x[channel name]x.api....
if the isLive status is false, I want some image in the html to stay as default (probably just a red dot). If the isLive status is true, I want the image in the html to change to a green dot or something.
I don't know how to use the script tags in html and I don't know javascript anyway so I have been spending a long time trying to solve this problem.
I have searched multiple sites for a solution from stackoverflow all the way to posting in the livestream.com forums.
If anyone can simplify this for me, that would be great!

Related

get source code of whole website - which loads additional content after scrolling down

I want to fetch this site
https://www.film-fish.com/modern-mindless-action
to fetch the IMDB IDs of all movies listed there.
The problem is that the page loads all movies listed there just after scrolling down. So, a simple wget doesn't work.
Even if I scroll to the bottom of the page and view the source code, I do not see the last movie in the list (Hard Kill (2020)).
So the problem seems to be that the content is being created via JavaScript.
Has anybody a tip on how to achieve that?
So the problem seems to be that the content is being created via a js
script. Has anybody a tip on how to achieve that?
Indeed, executing JavaScript code is beyond scope of GNU Wget. You would need browser automation tool. If you know some Node.js or JavaScript I suggest taking look at PhantomJS Quick Start, Page Automation. Please take look at first example in 2nd link, you should be probably able to rework to your needs, i.e. instruct page to scroll down using JavaScript then extract what you need using JavaScript.

WYSIWYG Texteditor Image Delete/Upload Logic

Im using laravel with summernote wysiwyg text editor. I want user to be able to insert images to the text.
First i tried using the default summernote upload method. Basically it turns upload image to a base64 data url. Then after posting it, in a controller, that base64 is decoded into an actual image, saved to the server, and the img that src part is turned into a public image url that leads to the current server.
This worked fine with small images. But it didn't work well with big images. Post didn't work and i didn't get any error from anywhere. I assumed that it was because of the base64 part. I also saw THIS THREAD which made me wanna change base64 part even more.
So i switched to using onImageUpload callback without even thinking about it much. I saw lots of tutorials suggesting it.
With this callback, whenever user insert a image to the editor (before the post), OnImageUpload function is called in js. In that function, ajax sends to image to the controller, controller saves the image to the server and responds with its public url. Finally editor uses that url to show the image in the editor.
Issue starts here with deleting images.
There is a OnMediaDelete function which has issues. It does not work with delete/backspace key for example. And even if that worked properly, a user can insert pictures and leave the page (or use one bugs of the onMediaDelete callback) which means there isn't a easy way to determine if the uploaded image is actually used in a text or not. Server would be filled with unused images?
How do you deal with this? Should i upload the images to a temp file during the editing and carry them to a actual folder if there are being used after the post? This would require stuff like cron to keep temp folder empty won't it? Is this how people deal with this?
Or should i just disable uploading images with text editor? Maybe a small content management for images in another part of the server?
Whole thing feels so simple but i am really struggling with it. I feel like i am missing a huge point here. Please help me. Sorry for this weird question. Thank you

Facebook like and share button slowing website

I have setup a dynamic competition page where the query string determines what content you see.
For example (http://nectarfinance.com.au/dc=korinadrogan will show Korina's content, while no query string will show generic head office content).
The site (as is) is loading slowly, and I know it is happening because of the Facebook 'like and share' dynamic Facebook scripts on the page.
I was wondering if there is anyway to minify these script into one? Or if there is anyone to increase the load time of these scripts? or reduce the size of these scripts?
I'm not sure how to work around it as the files are externally hosted by Facebook.
I'll post the GTMetrix report in the answer below, as I can't post two links.
Thanks for your help

PHP Automatic screenshot without loading the DOM

I have a website for professional purposes which is displaying some text and graphs (using Google Charts).
I will take an example of one page : like 'http://mywebsite/board.php'
Let say google chart is inside one div in that page
div id='chart'
So my point is I want to run automatically using crontab (every morning 5am CET), some scripts which will screenshot that div where id ='chart' and get a .jpg of the chart.
My idea is then to use that .jpg for automatic email reporting using $email object from php.
Could someone please help me out and give some ideas on how to perform that task?

Clearbox JS "messages"

I am currently running Clearbox JS on my site so that users may view a larger version of an image once they have visited the images page. Now, I just recently implemented this and I have noticed that on every single page at the top of the page Clearbox JS echos the command that it is doing. Whether it be initializing, or viewing an image, or event rotating an image. I really do not want this message popping up at all. I would much rather being required to put a link somewhere on the website to the developers website then having to deal with this. If anybody knows how to remove this, please answer. I am providing a link to the website so that you know what I am doing as well as a pastebin link to the clearbox.js file which is the config file.
website: www.dsdwebdesign.net/bootstrap_apgnew/index.php
pastebin: http://pastebin.com/NgBgc34X
Try this somewhere in your page, or the cb_style.css file (but make sure you read their conditions, I am not sure if you are allowed to do this with this piece of software):
#CB_OSD{
display:none!important;
}
It should hide the box at the top.

Categories

Resources