Results 1 to 15 of 15

Thread: [RESOLVED] Why isn't it leeching the html??

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    431

    Resolved [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:
    1. 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">&nbsp;</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)
    Last edited by Zeratulsdomain; May 9th, 2006 at 12:32 AM.

  2. #2
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: Why isn't it leeching the html??

    Worked fine for me. Have you tried removeing 'icString'?
    VB Code:
    1. RichTextBox1.Text = Inet1.OpenURL("www.imageshack.us/")

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    431

    Re: Why isn't it leeching the html??

    Quote Originally Posted by Andrew G
    Worked fine for me. Have you tried removeing 'icString'?
    VB Code:
    1. RichTextBox1.Text = Inet1.OpenURL("www.imageshack.us/")
    Yes, still does not work...

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    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?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    431

    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...

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    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.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  7. #7
    Lively Member
    Join Date
    Oct 2004
    Location
    UK
    Posts
    119

    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

  8. #8
    Fanatic Member
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    760

    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:
    1. Dim FullDownload As Boolean
    2. Dim HTML As String
    3. Do Until FullDownload = True
    4.         DoEvents
    5.         HTML = HTML & Inet.GetChunk(9999, icString)
    6.         If InStr(1, lcase(HTML), "</html>") <> 0 Then FullDownload = True
    7. Loop
    8. RichTextBox1.Text = HTML
    If I helped you out, please consider adding to my reputation!

    -- "The faulty interface lies between the chair and the keyboard" --

    VB6 Programs By Me:
    ** Dictionary, Thesaurus & Rhyme-Generator In One ** WMP Recent Files List Editor ** Pretty Impressive Clock ** Extract Firefox History **

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    431

    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:
    1. Dim FullDownload As Boolean
    2. Dim HTML As String
    3. Do Until FullDownload = True
    4.         DoEvents
    5.         HTML = HTML & Inet.GetChunk(9999, icString)
    6.         If InStr(1, lcase(HTML), "</html>") <> 0 Then FullDownload = True
    7. Loop
    8. RichTextBox1.Text = HTML
    tnx, that seems to work... Ill use that method from now on.

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    431

    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:
    1. Do Until iHTMLOld = 5
    2.             DoEvents
    3.             If HTMLOld = HTML Then
    4.                 iHTMLOld = iHTMLOld + 1
    5.             Else
    6.                 iHTMLOld = 0
    7.             End If
    8.             HTML = HTML & Inet1.GetChunk(9999, icString)
    9.             HTMLOld = HTML
    10.            
    11.         Loop

    I do not know why the previous code was not working...

    I hate imageshack :P Why cant they be more like imagevenue :P
    Last edited by Zeratulsdomain; May 8th, 2006 at 06:59 PM.

  11. #11
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    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.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    431

    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...

  13. #13
    Fanatic Member
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    760

    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
    If I helped you out, please consider adding to my reputation!

    -- "The faulty interface lies between the chair and the keyboard" --

    VB6 Programs By Me:
    ** Dictionary, Thesaurus & Rhyme-Generator In One ** WMP Recent Files List Editor ** Pretty Impressive Clock ** Extract Firefox History **

  14. #14
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    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?

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    431

    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width