[RESOLVED] Why isn't it leeching the html??
This drives me crazy... Working with html is frustrating enough without me having to worry if my tools are working or not...
VB Code:
RichTextBox1.Text = Inet1.OpenURL("www.imageshack.us/", icString)
I get:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ImageShack® - Hosting</title>
<link rel="stylesheet" href="img/style-def.css" type="text/css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<script type="text/javascript">
var url = "http://imageshack.us/";
var title = "ImageShack.us® - Image Hosting";
function highlight(field) {
field.focus();
field.select();
}
function phpbb(){
window.open ('phpbb.php', 'phpbb', config='height=450, width=720, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no');
}
function vb(){
window.open ('vb.php', 'vb', config='height=450, width=720, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no');
}
function sm(){
window.open ('sm.php', 'sm', config='height=450, width=720, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no');
}
function ipb(){
window.open ('ipb.php', 'ipb', config='height=450, width=720, to
I want:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ImageShack® - Hosting</title>
<link rel="stylesheet" href="img/style-def.css" type="text/css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<script type="text/javascript">
var url = "http://imageshack.us/";
var title = "ImageShack.us® - Image Hosting";
function highlight(field) {
field.focus();
field.select();
}
function phpbb(){
window.open ('phpbb.php', 'phpbb', config='height=450, width=720, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no');
}
function vb(){
window.open ('vb.php', 'vb', config='height=450, width=720, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no');
}
function sm(){
window.open ('sm.php', 'sm', config='height=450, width=720, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no');
}
function ipb(){
window.open ('ipb.php', 'ipb', config='height=450, width=720, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no');
}
function favorites(){
if(document.all)
window.external.AddFavorite(url,title)
}
function disableme (what) {
what = document.getElementById(what);
what.disabled = true;
what.value="uploading...";
}
function validateForm(theForm)
{
if (theForm.name.value=="" ||theForm.email.value=="" ||theForm.subj.value=="" ||theForm.idea.value==""||theForm.email.value.indexOf("@")==-1 || theForm.email.value.indexOf(".") == -1) {
alert("ERROR: Either you did not fill the form out to completion, or your email address is incorrect.");
return false;
}
if (theForm.corr.selectedIndex==0) {
alert("You must select a 'Reason for Email' from the drop-down box.");
return false;
}
if (theForm.corr.selectedIndex==1 && theForm.idea.value.indexOf("http://")==-1) {
alert("You must include at least one link or URL pertaining to your request in the body of your email.\n The link or URL must begin with http://");
return false;
}
}
var buttonname = '"Browse..."';
function showoptions(what) {
var ext = what.value.substr(what.value.length - 3,3).toLowerCase();
switch (ext) {
case 'jpg':
case 'peg':
case 'png':
case 'gif':
case 'bmp':
case 'tif':
case 'iff':
document.getElementById('resizeoptions').style.display='';
document.getElementById('filetypeerror').style.display='none';
document.getElementById('butan').disabled=false;
document.getElementById('butan').value='host it!';
break;
case 'swf':
document.getElementById('resizeoptions').style.display='none';
document.getElementById('filetypeerror').style.display='none';
document.getElementById('butan').disabled=false;
document.getElementById('butan').value='host it!';
break;
case '':
document.getElementById('butan').disabled=true;
document.getElementById('butan').value=buttonname;
default:
document.getElementById('resizeoptions').style.display='none';
document.getElementById('filetypeerror').style.display='';
document.getElementById('butan').disabled=true;
document.getElementById('butan').value='bad file type';
break;
}
}
function doload() {
what = document.getElementById('butan');
if (document.getElementById('fileupload').value == '') {
what.disabled=true;
what.value = 'select an image using ' + buttonname;
document.getElementById('resizeoptions').style.display='none';
}
document.getElementById('optsize').disabled = !document.getElementById('optimage').checked;
}
function toggleuploadmode(file) {
if (file) {
document.getElementById('upfile').style.display='block';
document.getElementById('upurl').style.display='none';
document.getElementById('upform').action='http://www.imageshack.us/index.php';
} else {
document.getElementById('upfile').style.display='none';
document.getElementById('upurl').style.display='block';
document.getElementById('upform').action='http://www.imageshack.us/transload.php';
}
}
function focusfield(fl) {
if (fl.value=="paste image url here") {
fl.value='';
fl.style.color='black';
}
}
-->
</script>
</head>
<body bgcolor="#F7F7F7">
<table width="760" cellspacing="0" cellpadding="0" border="0" align="center"><tr><td><a href="http://imageshack.us/"><img alt="ImageShack® Logo" src="http://imageshack.us/img/imageshack.png" title="" /></a></td><td valign="bottom" align="left">
<b><a href="http://imageshack.us/">ImageShack®</a>
| <a href="http://imageshack.us/slideshow/">Slideshows</a> | <a href="http://reg.imageshack.us/content.php?page=features">Tools</a>
| <a href="http://reg.imageshack.us/content.php?page=faq">Common Questions</a>
| <a href="http://reg.imageshack.us/content.php?page=rules">Terms of Service</a>
| <a href="http://reg.imageshack.us/content.php?page=register">My Images</a></b>
</td></tr></table>
<div class="don" style="color: #ccc">img218 at 38.99.76.18</div><table cellpadding="5" width="760" border="1" bordercolor="#CCCCCC" class="table_decoration" align="center"><tr><td valign="top"><!-- BEGIN STANDARD TAG - 300 x 250 - ROS: Run-of-site - DO NOT MODIFY -->
<SCRIPT TYPE="text/javascript" SRC="http://content.cpxinteractive.com/rmtag3.js"></SCRIPT>
<SCRIPT language="JavaScript">
var rm_host = "http://adserving.cpxinteractive.com";
var rm_section_id = 26437;
var rm_pub_redirect_dont_encode = 1;
var rm_iframe_tags = 1;
rmShowAd("300x250");
</SCRIPT>
<!-- END TAG -->
</td><td valign="top"><p>ImageShack's mission is to provide an easy-to-use image hosting service.</p><p><b><a href="http://reg.imageshack.us/content.php?page=faq">New to ImageShack</a></b>? Start an <a href="http://imageshack.us/slideshow/"><b>Image Slideshow</b></a>, or upload an image:</p><br />
<form method="post" action="http://www.imageshack.us/" enctype="multipart/form-data" onsubmit="disableme('butan')" id="upform">
<table cellspacing="0" cellpadding="0" border="0"><tr>
<td><p style="font-size: 11px;">upload: <input type="radio" name="uploadtype" onclick="toggleuploadmode(true);" checked>
file <input type="radio" name="uploadtype" onclick="toggleuploadmode(false);"> url</p></td>
<td width="2"> </td>
<td><div id="upfile"><input type="file" name="fileupload" size="30" onchange="showoptions(this)" id="fileupload"></div>
<div id="upurl" style="display: none"><input type="text" id="fileupload" value="paste image url here" style="color: #888;"
onfocus="focusfield(this)" name="url" size="30"></div></td>
(etc, was 2 long for this tread)
Re: Why isn't it leeching the html??
:ehh: Worked fine for me. Have you tried removeing 'icString'?
VB Code:
RichTextBox1.Text = Inet1.OpenURL("www.imageshack.us/")
Re: Why isn't it leeching the html??
Quote:
Originally Posted by Andrew G
:ehh: Worked fine for me. Have you tried removeing 'icString'?
VB Code:
RichTextBox1.Text = Inet1.OpenURL("www.imageshack.us/")
Yes, still does not work...
Re: Why isn't it leeching the html??
Are you sure you're waiting for the whole page to download before you look at it?
Re: Why isn't it leeching the html??
Quote:
Originally Posted by Al42
Are you sure you're waiting for the whole page to download before you look at it?
Yes... I even made it msgbox after... And EVEN added a whole other button, just so I could wait 10-20 seconds...
Re: Why isn't it leeching the html??
If what you pasted in the first window in post #1 is all you get, the page hasn't finished loading yet.
Re: Why isn't it leeching the html??
have you not considered using winsock instead, incredibly faster and from my own experience, easier to work with, upon receiving data, implement a timer and use a instr check.
If Instr(1, lcase$(strData$), "</html>") > 1 then
'//
End If
Re: Why isn't it leeching the html??
I've had this problem before with the Inet control. It is very unrealiable, so to solve your problem I suggest you use it in a loop like this:
VB Code:
Dim FullDownload As Boolean
Dim HTML As String
Do Until FullDownload = True
DoEvents
HTML = HTML & Inet.GetChunk(9999, icString)
If InStr(1, lcase(HTML), "</html>") <> 0 Then FullDownload = True
Loop
RichTextBox1.Text = HTML
Re: Why isn't it leeching the html??
I tried to find winsock yesterday, but it did not work...
Quote:
Originally Posted by shirazamod
I've had this problem before with the Inet control. It is very unrealiable, so to solve your problem I suggest you use it in a loop like this:
VB Code:
Dim FullDownload As Boolean
Dim HTML As String
Do Until FullDownload = True
DoEvents
HTML = HTML & Inet.GetChunk(9999, icString)
If InStr(1, lcase(HTML), "</html>") <> 0 Then FullDownload = True
Loop
RichTextBox1.Text = HTML
tnx, that seems to work... Ill use that method from now on.
Re: Why isn't it leeching the html??
eh, its not working on all URL's...
It like it gets the xhtml instead of the HTML sometimes... Even tho there is no ending "</html>"....
edit: One way to make it work is to tell it loop 100 times, instead of just until it finds the "</html>".... I guess I can tell it to keep leeching until it not getting any new data for 5 loops or something...
VB Code:
Do Until iHTMLOld = 5
DoEvents
If HTMLOld = HTML Then
iHTMLOld = iHTMLOld + 1
Else
iHTMLOld = 0
End If
HTML = HTML & Inet1.GetChunk(9999, icString)
HTMLOld = HTML
Loop
I do not know why the previous code was not working...
I hate imageshack :P Why cant they be more like imagevenue :P
Re: Why isn't it leeching the html??
I tried it 12 times - I got the entire site every time, just using the code you have in post #1.
Re: Why isn't it leeching the html??
Quote:
Originally Posted by Al42
I tried it 12 times - I got the entire site every time, just using the code you have in post #1.
If it works 4 you, it will continue to work, even if you try it as bunch of times. If it doesn't work, then it will continue to not work... It doesn't matter how many times you try it, odds are you will get the same result every time...
Re: [RESOLVED] Why isn't it leeching the html??
There are many reasons why it may or may not work on your specific system.
It could have to do with your internet connection speed, operating system or processor speed, so there's no use in arguing whether or not it works for you. If it doesn't work for him then we obviously need to find a solution for him
Re: [RESOLVED] Why isn't it leeching the html??
Maybe you changed some properties of the Inet hence it only downloads some of the data, or you might hava a limit on the richtextbox?
Re: [RESOLVED] Why isn't it leeching the html??
Quote:
Originally Posted by Andrew G
Maybe you changed some properties of the Inet hence it only downloads some of the data, or you might hava a limit on the richtextbox?
Maybe everyone is out 2 get me? Cause richtextbox limit is not beyond the source code of that site... Besides, at one point I was msgbox'ing the last 20 characters of my variable to make sure it was not some limit on the textbox.
Either way, as long as it continues to work the way I coded it, its all good...