Count JS/CSS file usage - html

I am doing research on usage of JS/CSS files on website. Let me put it this way. I want to (automatically) visit every page on website and make statistics how many times was JS/CSS file used (included into page).
Is there any tool for this or will better to write own script, which will open every anchor link within the same domain, and look into HTML header for JS/CSS file existence?
Thanks for replies.

Late to the party but for the record...
I would highly suggest checking out PhantomJS and CasperJS

Related

Using an HTML template across multiple subdirectories

I run a website for my photography where I have a stories page (http://www.traumantic.com/stories.htm) that is a long list of choices that lead to a sub folder and a gallery of images for that session.
I have an index.htm file in each of those folders that displays the gallery chosen.
I am trying to develop a new format for my pages, and putting it in place means replacing dozens of index.htm files and editing each one for that new format. A boatload of work.
I have noted that a lot of news sites seems to have a method of using a single template for the main body of the page and the elements of the news story are pulled in from another source.
I figured I could do this with XML like I did with my galleries, but I am lost.
I tried creating an XML file in a couple of text folders and then reading that form an HTM file two levels up. Didn't work.
Currently when you click on a link on my stories page, it opens the index.htm file in a sub-folder.
What I want to happen is this.
Clicking on a choice on my stories page launches an html template that reads the details from the folder.
The one html template would be used for all of the different story folders below. Making it far easier to modify the look of my web site quickly.
I'd rather put a ton a of work into designing this system that doing a mass replace and edit project on hundreds of files.
I hope this makes sense to some of you and that you can guide me to some study topics that will help me learn how to do this.
I am seeking advice on places where I can see example of this process.
The simplest option is to use an iframe
https://www.w3schools.com/tags/tag_iframe.asp
<iframe src="/path/to/file.html"></iframe>
Searching "html include" will yield a few guides that have various JavaScript implementations. (e.g., https://www.w3schools.com/howto/howto_html_include.asp)
If you're able to run php, you could use include
https://www.w3schools.com/php/php_includes.asp
But at that point, you might want to consider installing some sort of template engine like twig https://twig.symfony.com/doc/2.x/intro.html

How can I access/edit the HTML file on Shopify?

I know this is probably a very basic/obvious thing, but I'm new to Shopify and trying to assist a client while a colleague is on vacation. I know what I need to change and how to change it, but not how to access it. When I go to Online Store and click Edit Code, I see all the Liquid, JSON, and even CSS files, but I can't find the HTML file I need to edit, nor can I find any of the HTML I need to edit within the theme.liquid file. The resources I'm finding are all either outdated (there is no "Edit HTML/CSS" option on the dropdown anymore) or unhelpful (like this). I can see the HTML in the console and upon clicking View Page Source, but I don't know how to get to it through Shopify. I feel like I'm losing my mind because this HAS to be very simple and obvious. If someone could please tell me how to access and edit the HTML file on Shopify I would be VERY grateful!
The html files are the liquid files.
There are no actual HTML files since this is a Shopify theme.
Depending on your theme, your files are located in:
theme.liquid - here are the header and footer
templates/*.liquid - all liquid files here are the main templates for the different pages
sections/*.liquid - the files here are usually used on the homepage and other pages as well
snippets/*.liquid - these are the reusable code snippets
So depending on your changes you will need to go through these files and update them for the specific changes.
Please have in mind that these files may be used on multiply pages and if you change one of them there is a possibility that this will affect other pages as well.

Google analytics for different .html files in the same domain

Let's say that my website is www.myWebsite.com.
I have set up google analytics in index.html file properly and I get all the statistics fine in my dashboard.
Now my website has also got other html files, in the folder: www.myWebsite.com/folder/file1.html and www.myWebsite.com/folder/file2.html.
I want to track these pages too, and get how many view each page has.
In order to do this, do I have to use the same scripting code from analytics that I got for www.myWebsite.com ? And should the dashboard appear each page's views separately? Or do I have to set up different code for these pages?
I hope that I explained my problem well. Thank you in advance :)
Yes, you need to include the Analytics tracking code into the source code on every page you wish to track. This means including it in index.html and file1.html etc.
You can find more info in the Google Analytics help page.
You have to include generated code in every page that you wish to track.

Edit / personalize PirateBox's HTML file?

So I have made a PirateBox, but I wish to make edits to the HTML file - to give more functionality and a new look to the webpage. I am confident that I can edit it - but I can't find it. I have looked online and on this site for answers, to no avail.
An additional inquiry: Do I need to re-flash the router / firmware once I edit the HTML file? This question really isn't too much of a concern at this point, though.
Thanks to all that can help me out!
So I found a great guide to personalize the PirateBox - including the HTML file. Here is the page.
To quote the page:
Change the index.html page
I don’t really like the index.html page as it does not show the files available, more over the english language is not adapted of every one, so I prefer a frame organization mixing files, local text and chat area.
The index.html file can be changed by replacing it: create a new one and copy it to the following place: /opt/piratebox/www/index.html
It also includes a guide to change the SSID and the Chat settings.

Download from URL (PATH) - iPhone

I got a little Question.
I'm working on an App, and for that I have to download an HTML File with the including CSS and Images.
And Yeah, there's an API for that (ASIHTTPRequest), but I wan't to publish my App to the App Store and I don't want to use 3rd party API's.
And Parsing the HTML code is a bit hard :(
And It would also work for me, if I could download the whole path of a URL.
For example:
I have this URL: http://example.org/smthg/.
At this path I have:
-index.html
-logo.png
-style.css
And I want to download all this files AUTOMATICALLY, and not every single file.
But I don't think, that you can find out which files are on the server, right? (without BruteForce).
I hope you know what I mean :)
You can use a UIWebView to download the content at the location and hold on to the WebView. You could also use NSURLConnection to download content at a URL if you want to save it unformatted and you have the URL's to the resources.
There's nothing wrong with using 3rd party frameworks, as long as they're good quality frameworks and you use them right. ; ) Apple just gives you the starting blocks to make an app, after all, and using open-source code can really speed up your project.
With that said, ASIHTTPRequest is a bit outdated and not well maintained. Instead, I'd recommend AFNetworking, which supports asynchronous downloads, background downloads, and blocks. See https://github.com/AFNetworking/AFNetworking .
Regarding your specific issue on downloading certain files, however, you might try creating a plist(s) on the server (if its yours that is, or else, bundled within the app perhaps) that would list all of the needed files and their download locations.
However, the issue you're liking going to quickly face- even if your app has all needed files downloaded, it still has to understand what to do with them. If its just HTML content, styles, etc, perhaps you can display it in a UIWebView ? However, be sure that your app is adding some useful functionality besides just being a web browser... (unless, of course, you're making an enhanced web browser... ;)
Good luck!