home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / sharewar / gdidbpro / data1.cab / Example_Files / projects / default / submit.scp < prev    next >
Text File  |  2000-05-26  |  3KB  |  125 lines

  1. ##########################################################
  2. # GDIdb demo script (c) 1999 Global Data Industries
  3. # This Web Site search engine URL submission script
  4. # will submit a database of web URL's to a number of
  5. # the main web search engines. Some search engines
  6. # require the submission URL and an e-mail address,
  7. # both of these are stored in the database table.
  8. ##########################################################
  9.  
  10.  
  11.  
  12. &datasource("Driver={Microsoft Access Driver (*.mdb)};DBQ=examples.mdb")
  13.  
  14.  
  15.  
  16. &defvar(?header?,?content?,?URLencoded?,?emailencoded?,?errorcode?)
  17.  
  18.  
  19.  
  20. &getdata("SELECT * FROM tblSubmitURLs")
  21. {
  22.     
  23.     ##########################################################
  24.     # URL encode e-mail address and submission URL
  25.     &replace(?URLencoded?,"?URL?"," ","+")
  26.     &pack(?URLencoded?,"?URLencoded?")
  27.     &replace(?emailencoded?,"?email?"," ","+")
  28.     &pack(?emailencoded?,"?emailencoded?")
  29.     
  30.     
  31.     ##########################################################
  32.     # Submit URL to search engines
  33.  
  34.     # whatuseek
  35.     &http(?header?,?content?,
  36.     "http://www.whatuseek.com/cgi-bin/addurl-shock",
  37.     "POST",80,
  38.     "url=?URLencoded?\&email=?emailencoded?")
  39.     &print_msg
  40.  
  41.     # AOL
  42.     &http(?header?,?content?,
  43.     "http://netfind.aol.com/cgi/nfadd_url.cgi",
  44.     "POST",80,
  45.     "url=?URLencoded?\&email=?emailencoded?\&look=netfind")
  46.     &if("nfthanks.html",in,"?header?") { &print("?URL? Added to AOL..") }
  47.     
  48.     # Excite
  49.     &http(?header?,?content?,
  50.     "http://www.excite.com/cgi/add_url_new.cgi",
  51.     "POST",80,
  52.     "url=?URLencoded?\&email=?emailencoded?\&Service=excite\&language=English\&country=UK\&channel=Computers/Internet")
  53.     &if("/info/add_url/thanks/",in,"?header?") { &print("?URL? Added to Excite..") }
  54.  
  55.     # AltaVista
  56.     &http(?header?,?content?,
  57.     "http://add-url.altavista.digital.com/cgi-bin/newurl\?ad=1\&q=?URLencoded?",
  58.     "GET")
  59.     &print_msg
  60.     
  61.     # lycos
  62.     &http(?header?,?content?,
  63.     "http://www-english.lycos.com/cgi-bin/spider_now.pl\?query=?URLencoded?\&email=?emailencoded?",
  64.     "GET")
  65.     &print_msg
  66.  
  67.     # hotbot
  68.     &http(?header?,?content?,
  69.     "http://www.hotbot.com/addurl.asp\?newurl=?URLencoded?\&email=?emailencoded?",
  70.     "GET")
  71.     &print_msg
  72.     
  73.     # webcrawler (uses POST, & returns a location: rather than a "thanks!" page)
  74.     &http(?header?,?content?,
  75.     "http://www.webcrawler.com/cgi-bin/add_url_new.cgi",
  76.     "POST",80,
  77.     "Service=webcrawler\&url=?URLencoded?\&email=?emailencoded?\&language=English\&country=UK\&channel=Computers/Internet\&look=excite")
  78.     &if("/info/add_url/thanks/",in,"?header?") { &print("?URL? Added to webcrawler..") }
  79.     
  80.     # send URL to infoseek in an e-mail
  81.     &sendmail("mail.mydomain.com","?email?","www-request@infoseek.com",formatnone)
  82. {
  83. HEADER:
  84. From: ?email?
  85. To: www-request@infoseek.com
  86. Subject: URL Submission
  87. Date: ?gdidbdate.dn?, ?gdidbdate.d? ?gdidbdate.mn? ?gdidbdate.y? ?gdidbtime?
  88. BODY:
  89. ?URL?
  90.  
  91. }    
  92.  
  93. }
  94.  
  95.  
  96.  
  97.  
  98.  
  99. ##########################################################
  100. # this sub strips the html tags off the returned page &
  101. # prints the text on the screen
  102.  
  103. &defsub("print_msg")
  104. {
  105.     &replace(?content?,"?content?","\r\n"," ")
  106.     &striphtml(?content?,"?content?")
  107.     &print("?content?")
  108.     &cls
  109. }
  110.  
  111.  
  112.  
  113.  
  114.  
  115. ##########################################################
  116. # catch and ignore HTTP errors
  117.  
  118. &defsub("on_error")
  119. {
  120.     &geterror(?errorcode?,FALSE)
  121.     &if((?errorcode?==119)||(?errorcode?==106))
  122.     {
  123.         &ignore
  124.     }
  125. }