I am running this wget, able to save everything (css, html, images, relative path reference etc) from a webpage, except the audio (alert.mp3, alert.ogg)
Is it due to limitation of wget when come to getting this audio from this format?
<?php
exec("wget --no-parent --timestamping --convert-links --page-requisites -erobots=off http://webpage/index.html");
?>
<html>
<body>
bla bla bla
<audio autoplay="autoplay" preload=""><source src="alert.mp3" type="audio/mpeg"><source src="alert.ogg" type="audio/ogg"></audio>
</body>
</html>
Related
The appearance Unicode Han Character 'U+200D0' (U+200D0) is as below:
Show in my browser:
The font setting in my browser is noto sans cjk sc:
It can't be shown in my browser!
Shown on my LXTerminal(debian10 + lxde + LXTerminal):
The font setting in my LXTerminal is as below:
python3
>>> '\u4f60'
'你'
>>> '\u000200D0'
'\x0200D0'
It can't be shown in the LXTerminal either.
Shown with mousepad:
Write it in /tmp/test.txt first and open it with mousepad.
x="\U000200D0"
fh = open('/tmp/test.txt','wb')
fh.write(x.encode('utf-8'))
4
fh.close()
It can't be shown with mousepad either!
How can set the font for my browser and terminal and mousepad(or os--debian) to make the han character U+200D0 be shown normally?
I found that it can be shown in my windows10(both in chrome and notepad).
Edit the test.html,and open it with chrome in my windows10.
<html>
<head>
<style type="text/css">
#font1{
font-family:"宋体";
}
#font2{
font-family:"Noto Sans CJK SC";
}
</style>
</head>
<p id='font1'>
try with font1 to show --𠃐
</p>
<p id='font2'>
try with font1 to show --𠃐
</p>
</html>
Open it with chrome in my debian10.
I have copied and installed Microsot YaHei font from my windows10 into debian10 this way:
sudo mkdir /usr/share/fonts/msyh
sudo cp directory_contain_microsof_yahei /usr/share/fonts/msyh
sudo chmod 644 /usr/share/fonts/msyh/*
cd /usr/share/fonts/msyh
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -fv
All the issue still can't be solved!
when I tried to curl some pages.
curl http://test.com
I can get like following result
<html>
<body>
<div>
<dl>
<dd> 10 times </dd>
</dl>
</div>
</body>
</html>
my desired result is like simply 10 times..
Are there any good way to achieve this ?
If someone has opinion please let me know
Thanks
If you are are unable to use a html parser for what ever reason, for your given simple html example, you could use:
curl http://test.com | sed -rn 's#(^.*<dd>)(.*)(</dd>)#\2#p'
Redirect the output of the curl command into sed and enable regular expression interpretation with -r or -E. Split the lines into three sections and substitute the line for the second section only, printing the result.
So I am a novice at Web development and I am trying to create a website and am using WAMP to test out my PHP code and such. The issue I'm running into is that when I change my file, and try to refresh my localhost page on my browser, it gives me a file not found error. When I close out the localhost page and reopen it, the page that I changed appears properly and is updated properly.
I was just wondering whether there is an issue with my WAMP or whether having to open a new localhost page is necessary every time a file is updated?
I would ensure the file path is correct, double check that you are dev-ing from the same folder that you are viewing in localhost. Also what worked for me is doing a browser cache refresh which is different from a simple refresh. http://refreshyourcache.com/en/cache/
Windows: ctrl + F5
Mac/Apple: Apple + R or command + R
Linux: F5
<link rel="stylesheet" href="http://localhost/CI-social-media/css/registration_form.css?v=<?php echo time(); ?>">
<script language="javascript" src="http://localhost/CI-social-media/js/registration_form.js?v=<?php echo time(); ?>"></script>
<link rel="stylesheet" href="http://localhost/CI-social-media/css/registration_form.css?v=<?php echo time(); ?>">
<script language="javascript" src="http://localhost/CI-social-media/js/registration_form.js?v=<?php echo time(); ?>"></script>
use this & solved problem
just add ?v=<?php echo time(); ?> after href="('path/url') then after "
just add ?v=<?php echo time(); ?> after src="('path/url') then after "
<link rel="stylesheet" href="http://localhost/CI-social-media/css/registration_form.css?v=<?php echo time(); ?>">
<script language="javascript" src="http://localhost/CI-social-media/js/registration_form.js?v=<?php echo time(); ?>"></script>
I've problem with cron job.. I set cron job to running a file every five minutes, but thats not work... Cron job not running file, the code:
<?php
set_time_limit(1000000000000000);
include $_SERVER['DOCUMENT_ROOT'].'/includes/connect.php';
mysql_connect('localhost', 'root', '') or die(mysql_error());
mysql_select_db("database") or die(mysql_error());
$getinfo = mysql_query("SELECT * FROM something WHERE game_id = '2'") or die(mysql_error());
while($servers[] = mysql_fetch_assoc($getinfo)){
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
</head>
<body>
</body>
</html>
Thanks all who try to help...
Scripts rely on a special syntax to pick the interpreter to use. If you point the crontab entry directly at the file there is no way to determine the interpreter to use. If you look in any shell script you'll see a first line like:
#!/bin/sh
This points to the interpreter for the script. Point it at your php binary or call the script using
php /path/to/script.php
You also need to ensure the file has the executable permission set:
chmod +x /path/to/script.php
I found this page by googling "php run as script" which says roughly the same thing but with more details:
http://blog.johan-mares.be/ict/php/running-php-shell-scripts/
I have a site where users can stream my music from a flash player or download the individual songs (as mp3s). Right now if you click on the download links, they just play in the browser. Can I make it so the download box will pop up by default without either zipping the files making the user rt. click?
I have my index.php page with the links looking like this (pulling file names dynamically from mySQL:
<table>
.
.
.
<td>
<?php include 'Media/' . $row['type'] . '/' . $row['folder_name'] . '/download.php' ?>
</td>
and then download.php has this:
<div class="downloadCell">
<h3>Downloads:</h3>
<ul>
<li>
Chemtengure
</li>
</ul>
</div>
and I put the auto_download.php in the same directory as index.php:
auto_download.php:
$path = $_GET['path'];
header('Content-Disposition: attachment; filename=' . basename($path));
readfile($path);
You will need to add this HTTP header to your response to make the browser force a download:
Content-Disposition: attachment; filename=your_filename.mp3
For example, if you're using PHP on the server side, you can create a script that sends the above header followed by the actual file contents:
$path = $_GET['path'];
header('Content-Disposition: attachment; filename=' . basename($path));
readfile($path);
If you call this script download.php, then linking to download.php?path=/path/to/your/file.mp3 will make the browser pop-up a download dialog for file.mp3.