|
for example..
if you you check this URL:
http://x.co/bDHC[^]
The title in the tag is:
Android Hits 200 Million Activations - Mobility - Smartphones - Informationweek
but when I type it in linkedin it will automatically detect the title as:
Android Hits 200 Million Activations
which is the article's title..
I am now sure if <headline> meta tag has anything to do with it because the source of the page shows:
<meta name="headline" content="Android Hits 200 Million Activations" />
|
|
|
|
|
The usual approach would be to look for the first heading tag using preg_match.
You could also look for the <title> tag.
<meta> elements are usually only useful if you're looking at pages where you know that metadata has been added, and know the metadata profile that has been followed.
|
|
|
|
|
What these websites do is load the website on the server and parse the received html to extract information such as the title. The probably use cURL in combination with some PREG regex.
|
|
|
|
|
hi everybody,
I have a problem about php.Can u help me?
Now, i need to get something from another server in PHP.
<table cellpadding="2" cellspacing="12" border="0" align="center" width="600" style="font-family:'Trebuchet MS'; font-size:16px; font-weight:bold;">
<tr>
<td bgcolor="#FFFFFF" width="170" align="center">34 TYT 34</td>
<td width="100" bgcolor="#FFFFFF" align="center">805000 TL</td>
<td width="100" bgcolor="#FFFFFF" align="center">810000 TL</td>
<td width="100" bgcolor="#FFFFFF" align="center">3800 TL</td>
<td width="100" bgcolor="#FFFFFF" align="center">3900 TL</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" width="170" align="center">YARIM PLAKA</td>
<td width="100" bgcolor="#FFFFFF" align="center">402500 TL</td>
<td width="100" bgcolor="#FFFFFF" align="center">405000 TL</td>
<td width="100" bgcolor="#FFFFFF" align="center">1900 TL</td>
<td width="100" bgcolor="#FFFFFF" align="center">1950 TL</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" width="170" align="center">ÇEYREK PLAKA</td>
<td width="100" bgcolor="#FFFFFF" align="center">201250 TL</td>
<td width="100" bgcolor="#FFFFFF" align="center">202500 TL</td>
<td width="100" bgcolor="#FFFFFF" align="center">950 TL</td>
<td width="100" bgcolor="#FFFFFF" align="center">975 TL</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" width="170" align="center">1 BİJON</td>
<td width="100" bgcolor="#FFFFFF" align="center">50312.5 TL</td>
<td width="100" bgcolor="#FFFFFF" align="center">50625 TL</td>
<td width="100" bgcolor="#FFFFFF" align="center">237.5 TL</td>
<td width="100" bgcolor="#FFFFFF" align="center">243.75 TL</td>
</tr>
</table>
I want to add this data in my website as curl.Actually i don't know php very well.I guess we can use file_get_contents().But how we can use it for table html?
|
|
|
|
|
|
|
Hi. New in python but managed to find my way around. I have a folder named date(i.e 20111011, or 20111101). The script goes and ftps the folder that matches the date passed(python CallTibcoWS.py 20111104). If the folder name matches the date passed then it will copy the folder to a specified location. Now I want to use the same code to copy files. I have another folder(folder name not important), with files. File extensions are dates(i.e name.20111111, surname.20110102, python.20101111). I want to copy all the files that match the date passed when I run the script(python CallTibcoWS.py 20111104).....My code is as below
import os
import datetime
import time
import sys
import subprocess
import paramiko
import platform
WSDESCRIPTOR = 'ESSImporter'
LOGFILE = 'C:/Logs/%s/%s_%s.log' % (WSDESCRIPTOR.lower(), WSDESCRIPTOR, datetime.datetime.now().strftime("%Y-%m-%d"))
TIBCOSERVER = 'GenevaServer'
TIBCOPORT = '7979'
WEBSERVICEADDRESS = "http://%(server)s:%(port)s/ESSImporter/Services/Interface/intfESSImporter-service.serviceagent/intfwsProcess_ESSImporterEndpoint1" % {'server': TIBCOSERVER, 'port': TIBCOPORT, 'ws': WSDESCRIPTOR}
FILEPATH='/export/home/extracts/out/%s'
REMOTEPATH='C:/ESSSWAP/Ess_Import/%s'
FTPSERVER = 'Server'
FTPUSER = 'test'
if platform.system().upper() == 'WINDOWS' : #dev environment
FTPPASSWORD = "C:/Priv_Key.ppk"
else:
FTPPASSWORD = "/export/Priv_Key.ppk"
FILEEXT = 'date is the extension_%s' % (datetime.datetime.now().strftime("%Y-%m-%d"))
FILELIST = (('basket_div_SA.0', 'basket_div_SA'), ('basket_payment_SA.0', 'basket_payment_SA'), ('basket_summary_SA.0', 'basket_summary_SA'), ('basket_swap_SA.0', 'basket_swap_SA'), ('basket_trade_SA.0', 'basket_trade_SA'), ('interest_detail_SA.0', 'interest_detail_SA'), ('unwind_SA.0', 'unwind_SA'))
def getfile(ftphost, fromfile, tofile, tibcoinstanceInfo=None, tibcoinstanceError=None):
if tibcoinstanceInfo:
tibcoinstanceInfo('Connecting to %s as %s with pw %s' % (ftphost, FTPUSER, FTPPASSWORD))
try:
t = paramiko.Transport((ftphost, 22))
key = paramiko.RSAKey.from_private_key_file(FTPPASSWORD)
t.connect(username=FTPUSER, pkey=key)
sftp = paramiko.SFTPClient.from_transport(t)
print(fromfile)
if sftp != None:
sftp.get(fromfile, tofile)
sftp.close()
if tibcoinstanceInfo:
tibcoinstanceInfo('FTP of the file was successful')
result = True
else:
if tibcoinstanceError:
tibcoinstanceError('Could not connect to the FTP server')
result = False
except Exception, e:
if tibcoinstanceError:
tibcoinstanceError('Error FTPing the file from %s to %s: %s: %s' % (fromfile,tofile,e.__class__, e))
result = False
return result
kagiso
|
|
|
|
|
Do you want to discuss the code (structure, style, guidlines) or do you have a question about functionality(or the lack of)? For the discussion please state what you'd like to discuss, for the question elaborate on what exactly is not working.
Cogito ergo sum
|
|
|
|
|
Hi,
I am using this code to have a clean page layout..
I want to know, using my code how can I specify different page title for every page?
here is the code
http://www.rmc.bh/temp/Myfiles.zip
Thanks,
Jassim
|
|
|
|
|
take a variable, say $Title, use it in header.php this way
<?php ?>
<TITLE><?=$Title?></TITLE>
<?php ?>
<TITLE><?php echo $Title?></TITLE>
and in the main pages do like this
main.php
$Title="Title for Main Page";
require_once("header.php");
|
|
|
|
|
I think you know the answer of this question then why posting it...........
Thanks & Regards
Arya1685
"You are not only responsible for what you say, but also for what you do not say"
|
|
|
|
|
Hi,
What's your advise for the page layout? I mean if I have a top header and a bottom footer then left side navigation menu and rest is contents.. should I tables for it?
Thanks,
Jassim
|
|
|
|
|
Table is the best solution for fomatted view and make sure all 4 part belongs to 4 different files
|
|
|
|
|
It's good to use table tag for your site.............
Thanks & Regards
Arya1685
"You are not only responsible for what you say, but also for what you do not say"
|
|
|
|
|
Thanks everyone
|
|
|
|
|
Table is okay but div is recommended because that is what I use for my page layout in all applications I write.
|
|
|
|
|
Hi,
Please check this:
http://www.rmc.bh/dept
and the same here http://www.rmc.bh/en/team
why the two boxed on the left (contents) and right (menu) is taking 50% even when I am setting 100% for the content and 200px for the menu?
here is the dept.php:
<body dir="rtl" lang="ar-bh">
<table width="100%" cellpadding="0" cellspacing="10px" border="1">
<tr><td colspan="2"><?php include("header.php"); ?></td></tr>
<tr><td colspan="2"><hr></td></tr>
<tr>
<td valign="top" width="200px"><?php include("menu.php"); ?></td>
<td valign="top" width="100%">
<h2>الأقسام</h2>
</td>
</tr>
</table>
and this is the menu.php just in case:
<html>
<head>
<style type="text/css">
.sidebarmenu ul{
margin: 0;
padding: 0;
list-style-type: none;
font: bold 13px Verdana;
width: 180px;
border-bottom: 1px solid #ccc;
}
.sidebarmenu ul li{
position: relative;
}
.sidebarmenu ul li a{
display: block;
overflow: auto;
color: white;
text-decoration: none;
padding: 6px;
border-bottom: 1px solid #778;
border-right: 1px solid #778;
}
.sidebarmenu ul li a:link, .sidebarmenu ul li a:visited, .sidebarmenu ul li a:active{
background-color: #012D58;
}
.sidebarmenu ul li a:visited{
color: white;
}
.sidebarmenu ul li a:hover{
background-color: black;
}
.sidebarmenu ul li ul{
position: absolute;
width: 170px;
top: 0;
visibility: hidden;
}
.sidebarmenu a.subfolderstyle{
background: url(right.gif) no-repeat 97% 50%;
}
* html .sidebarmenu ul li { float: left; height: 1%; }
* html .sidebarmenu ul li a { height: 1%; }
</style>
<script type="text/javascript">
var menuids=["sidebarmenu1"]
function initsidebarmenu(){
for (var i=0; i<menuids.length; i++){
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
ultags[t].parentNode.getElementsByTagName("a")[0].className+=" subfolderstyle"
if (ultags[t].parentNode.parentNode.id==menuids[i])
ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px"
else
ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px"
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.display="block"
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.display="none"
}
}
for (var t=ultags.length-1; t>-1; t--){
ultags[t].style.visibility="visible"
ultags[t].style.display="none"
}
}
}
if (window.addEventListener)
window.addEventListener("load", initsidebarmenu, false)
else if (window.attachEvent)
window.attachEvent("onload", initsidebarmenu)
</script>
</head>
<body>
<div class="sidebarmenu">
<ul id="sidebarmenu1">
<li><a href="http://www.rmc.bh/en">ENGLISH</a></li>
<li><a href="http://www.rmc.bh/">الصفحة الرئيسية</a></li>
<li><a href="about">حول المركز</a></li>
<li><a href="team">الأطباء</a></li>
<li><a href="dept">الأقسام</a></li>
<li><a href="services">الخدمات</a></li>
<li><a href="album">ألبوم الصور</a></li>
<li><a href="health">صحتكم تهمنا</a></li>
<li><a href="careers">التوظيف</a></li>
<li><a href="contact">اتصل بنا</a></li>
</ul>
</div>
<br><br><div style="text-align: center;"><a href="http://webmail.rmc.bh/" target="_blank"><img src="images/staff_email.jpg" border="0" /></a></div>
</body>
</html>
|
|
|
|
|
one html page can have one HTML section one head section, one body section but you have two for all of them ............
remove all and realted meta from your menu.php
Then we will discuss further
|
|
|
|
|
Freat.. Appreciate..
One question before I start please..
I have many things in my meta tags..
can I use a php file for it and inculde it withing the ? ho? just normal include?
|
|
|
|
|
|
ok johny
it looks better now
but can you please tell me why do i have the space above the side menu? I checked everywhere anc can't see it? the side menu should start in the same level of the contents...
www.rmc.bh/dept
Thanks,
jassim
|
|
|
|
|
you are making this page as utf-8
make sure the files are without BOM
|
|
|
|
|
where is the BOM in this page?
http://www.rmc.bh/dept[^]
Also, one more question Johny...
I am currentlly testing the above page and it's fine then I will apply on all pages but I have noticed it's all somehow the same exvept big difference in IE.in positioning the contents when I use different browsers?
Here is the print screen of the same page on different browsers (browser name is the file name).
How can I fix it?http://www.rmc.bh/temp/dept.zip[^]
Thanks,
Jassim
|
|
|
|
|
In general there is some difference from browser to browser. the differences are mostly in Javascript and css.
But one thing you must have to notice you must have to close all the tag that has ending. as example div has start tag and closing tag, if you miss closing tag some browser will not make any trouble but some browser will fail
|
|
|
|
|
I'm doing a mini project on reading messages from forum using TTS.
I have tried searching many resources but I still couldn't find any free tts software. I'm just trying to implement in my mini project, not commercializing it or anything.
This link, http://www.phpclasses.org/package/4097-PHP-Convert-test-to-speech-using-Expressivo-service.html I thought it might work, but as soon as I used it, I got an error about the code about some unknown txt variable, although it was declared. Someone commented this is a paid service so I guess it doesn;t work now.
Can anyone help me in this matter? I'm using Dreamweaver CS5 and XAMPP's PHPMyAdmin as my database.
|
|
|
|