How can I get the web page size programmatically? [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is there a way to get web page size using php or javascript ?
I want to do this for 100s of domain.
Edit
I am not sure what it means
Thanks

if you don't need the page don't use file_get_contents() you transfer the whole file for nothing.
instead use
get_headers ( string $url [, int $format = 0 ] )
then just extract the Content-Length
UPDATE- for checking if its changed use the above then compare Last-Modified

You could use file_get_contents() and then simply read the byte size of the result. There are also online tools which you can make a use of their APIs.
Also note, file_get_content() will simply get the content of the webpage as string, that is being said, if you are wanting to get the size including images and etc then you can use something like http://php.net/manual/en/function.stream-get-contents.php

Related

How can I acess a website's localstorage from another website? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I would like to access website A's localstorage from website B's script, how could I do that?
If that is not possible in any way how could I save a string from website A (using a JS script) to my computer and how could I read it from website B's script?
One possible option is to make a .txt file in the same root directory and provide its path to where you want to use the string.
If you want to use it in a javascript file, you can refer: How to read text file in JavaScript
I hope this helps!

What is the fastest way to consume an JSON? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I call a JSON with 7000 objects (I use the JS filter direct in the GET's scope and keep the response in a variable) by GET's axios and as you can see from the image it's taking too long, affecting SEO :(
It's 3 seconds delay!
I've done something:
I packed JSON with gzip
I used minify in the JSON*
I put cookies for 1 year on htacess
I put the direct filter on the GET call
Things I want to do but I am unsure and I need your help:
Use Algolia
Split JSON into parts
Can anyone help me please i can't find the answer is i have been looking for this for months :(((
You can implement pagination on your backend to send JSON in smaller peaces or open an stream to read the JSON string and parse it as it's comes

I want to add the button of screenshot of my customer's page and then want it to save in a database and show it in a another page as dashboard [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I tried using java script but it didn't work. I also tried php imagegrabscreen() but it demands URL whereas I have a customer's page URL different for everyone ex: /member.php?email=shady#gmail.com&code=A101_123 .
Basically I want to store user's screenshot so he can be able to see those images of his activity. So any solution?
I would recomment to take a look at html2canvas. It is a JavaScript solution that works on the client side. Only problem: It takes the current DOM from the user and builds a picture with the browser engine. So it is not 100% accurate, but pretty close.

Writing an array data into external file [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am using this demo
pitch detector
to get the pitch of an input data, what I need is to write that captured data into external file or to make a some kind of sine wave to see the frequency of that data
or even better to see what frequencies I don't need. That demo can't show me the more or less precise pitch of the played string,
I searched a lot but nothing seems to fit me. Please help.
You can send the extracted data to a backend service using a form or AJAX. You could also store it in localStorage, sessionStorage or the browsers embedded database like IndexedDb or WebSQL. You could then mine that data in your browser. You could also save the data using the File API, although that is not widely supported across browsers.

How to get access to cross domain content? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Two webpages, http://website.com/home.php and another one is on my dropbox http://dropbox.com/myId/public/myfile.html.
I want to run a user script (which will be given out to other people) on home.php with some values, basically some 9-10 numbers. These values are already defined in the script. But they have to get updated on a regular interval, this is done by the user clicking a link or something. These updated values will be on myfile.html. I have full control over this file.
I have tried using localStorage in the script but that doesn't allow to share content over different domains. iframe also doesn't work due to cross domain. But is there a way that these values can be released by a function() on need.html when the iframe loads on home.php?
I'm pretty new to javascript, so I don't know everything.
What you need is JSONP. Here is more on that
I found out how to do it:
I created a script element using the userscript in home.php which links to need.js instead of need.html.
need.js contains code to add the "values" to localStorage.

Categories

Resources