name downloaded files after specific html element - html

In an nutshell:
I am looking for a way to automatically download files, listed as linkes on a website and give them meaningful names.
The situation:
There is a small radio show, I really love. It uploads FREE podcasts of there show. I recently found them and would like to download ALL of there shows (again they are free, so this is no copyright issue). Unfortunately on the website one can only download them one by one plus they .mp3s are given useless names.
The code of the side would look like this (maybe 1000 times...) .
Example:
<a href="theWebsite.com/subSide/abc.mp3>The name of the mp3</a>
Is there a way to download them automatically or at least give them a meaningful name ("The name of the mp3.mp3" instead of "abc.mp3").
Could you recommend a tool or have an idea how I could approach this problem?
Thanks a lot!

just add the download attribute to the "a href tag". The string you assign to such attribute will be the name of the downloaded file. In your case, for example, you can do it like this:
The name of the mp3

Related

Sitemap for site with few dynamic HTML files and many possible URLs

I'm nearing the end of my first web development project and I'm looking to build a sitemap for our website as part of Search Engine Optimalisation. If I understand correctly a sitemap, when done correctly, is a file that shows a content tree (similar to paths in windows explorer) to all the public pages of my website.
For the purpose of my question you're going to need some background information on the site and how it works. The site is about bird migration, a user enters the site on a homepage that holds a searchbox, he or she is able to search for a species of birds and if we have data on it the user is able to go to a seperate page with information on this bird. From there the user can access statistical data about this species. The page will look something like below, filled with content that we get from a database.
The URL will look something like http://domain.com/searchbird.html?bird=Sedge%20Warbler?lang=1 for the informational page, and http://domain.com/statistics.html?bird=Sedge%20Warbler?lang=1 for the statistical page.
Every bird species uses the same base HTML file (searchbird.html) that is filled with data based on the ?bird="" parameter. I have about four HTML files in my webroot (lets call them: index.html, searchbird.html, statistics.html, about.html).
So when I go to create a sitemap using some sort of sitemap generation tool, I get a sitemap that contains those 4 .html files, which is great! Yet I'm missing the 500 bird species that users are going to be able to find.
Is there a way for me to include every possible URL in the sitemap automatically, and how would I go about doing such a thing? I've used HTML, CSS and Javascript in the past. but I'm only a beginner. If an executable tool exists for this that'd be great, but my Google searches haven't been successful yet.
You have to generate the list of URLs for your existing pages.
So dig into your data source (database or whatever you use), find all existing bird species, and generate the two URLs per species.
Directory for users/bots
It would probably be a good idea (for visitors as well as for bots) to output these links on your website, too. Visitors would have two ways to find a species (search for it or browse the directory), and as most bots don’t use search functions, they wouldn’t be able to find the links on your site otherwise (they would have to use your sitemap, which not all bots do, or they would have to hope to find the links from some other external website).
(If you do this, you could also use a sitemap generator service; but it’s usually better do generate it yourself.)
URL design
By the way, you might want to consider changing your URL design to a more human-friendly one. Instead of
http://example.com/searchbird.html?bird=Sedge%20Warbler?lang=1
http://example.com/statistics.html?bird=Sedge%20Warbler?lang=1
you could use something like
http://example.com/en/birds/sedge-warbler
http://example.com/en/birds/sedge-warbler/statistics
where en is the language code for "English" (these are standardized, and users have a chance to understand them, contrary to lang=1), and where http://example.com/en/birds could lead to the page listing all species. For other languages, you would of course ideally translate "birds" and "statistics".
Changing the URL design is possible with URL rewriting.
U can use sitemap generator. U can use https://www.xml-sitemaps.com/. U only need put url index. That website will search all link and generate sitemap automatically.
If u use wordpress u can use plugin wordpress like https://wordpress.org/plugins/google-sitemap-generator/.
Hope that help

Convention for adding data to a clickable element

This question is perhaps too philosophical for SO but I wanted to give it a try.
We are using a tool called Google-Tag-Manager to track website events. GTM listens for clicks and you can filter based on e.g. element class or id.
Consider this scenario. We have several pdfs on particular page and wnat to know how popular they are. The pdfs can either be downloaded or viewed online. The pdfs each have a name. So I need to get the following data:
whether downloaded pdf or viewed online
the name of the pdf
For name we can presumably use name or title attribute. But whether viewed online or downloaded is more custom.
I am currently going to ask our developers to edit the html in such a way that I can configure GTM to listen for these clicks and pass the data back into our web reporting tool.
I can tell them to add a class to all of them e.g. class='pdf_clicks". What would a conventional means of adding the other two data points? A custom attribute? I know I can use title for name. What about whehter or not was viewed online or downloaded? Is there a generic meta data type attribute for this?

Save file with different name from original (html)

I want to put a link on html which downloads a file with different filename from original. So for example there is this PNG file:
https://www.google.com/images/srpr/logo11w.png
I would like to put it into html so that when you click to download it, it saves not as "logo11w.png" (which is the original name) but as another name, for example: "Google Logo.png"
I actually had saved the code to do this on my computer and now i have lost access to it and can't seem to find it on google, i tried several search queries. However, I remember it was a pretty short html code (1 line) however I just want to make this possible no matter if you guys give me another code, all that matters is that it works. Thanks!
Faced the same problem today and stumbled upon your question. Here's what I found:
Download logo
You can also achieve the same through javascript, here's the link:
http://www.w3schools.com/jsref/prop_anchor_download.asp

Use environment variable in link in email

I want to generate links that can be pasted in emails so I can show people folders in their directory structure such as where to edit their email signature manually.
I'm trying to put a link to the folder in an email but make it generic enough that when they forward it, everyone who opens it will get the link into their own directory structure properly so I need to use environment variables.
I type the text I want the link to say then highlight and CTRL-K then put %CSIDL_APPDATA%\Microsoft\Signatures\ in the link but Outlook changes my % symbols to %25's. I'd ask how to escape a % but it shouldn't be escaped I don't think since it's actually part of a link.
Environment variable list FYI:http://technet.microsoft.com/en-us/library/dd560744(v=ws.10).aspx
Simple answer, you can't. When you're linking like that, the current directory looks like root / to the html. So you could look at a subfolder of current directory (which you aren't guaranteed to know since it could be different on different OS's or even per user configuration) but that won't really help you.
This project will let you edit the actual HTML of your email by adding an Advanced tab but even with full control of the HTML, it can't be done. "It would open up a security hole the size of Denver."
Here's a lot of quality info on Relative Addressing which is what you're trying to do.
this is because outlook parse your input as HTML link.
I did not test it but you should give a try to this file://%CSIDL_APPDATA%/Microsoft/Signatures/
See this answer too : ways to make an html link open a folder

Parse multimedia files out of an HTML page (any language)

Given an HTML page I would like to get all the 'x' files that are embedded in the HTML file or are linked by it, where 'x' equals:
Images (JPG,PNG,GIF...)
Documents (Word, PowerPoint, PDF...)
Flash (.flv, .swf)
How do I do this?
So images are easy to extract because they are either linked to with a link ending in a (.png|.jpg|....) or they are embedded with an img tag.
Documents can not be embedded, they can only be linked to (with a link ending in a .doc|.ppt|.pdf|...). So they are also easy to get.
Here is my problem:
How do I get the flash files that are embedded in webpages?
Please give me a pseudo-algorithm or a regex pattern.
If I am wrong in my points above (1. and 2.) please tell me so too.
Thanks!
The Firefox extension DownThemAll lets you right-click a page and download all of the media of a specified extension. It's open source, so you might want to look at their code and see how they implemented it.
I'd use an event based XML parser (like SAX) and write the rules for the and tags to get the src and href attributes.