1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Retrieve data from website

Discussion in 'JavaScript' started by gurunathblessings, May 6, 2022.

  1. #1
    I am studying Astrology.

    I am trying to download some data from

    https://www.chaosastrologer.com/freeastrologycharts.cfm

    After clicking the following

    Astrological Ephemerides

    it will go to another page

    https://www.chaosastrologer.com/astroform/ephemeris.cfm

    Once the "Click Once" is pressed, the data will be shown as 1 whole page in

    https://www.chaosastrology.com/chaos1/reports/runastro_c.cgi

    If you were to refer to the attachment,

    I only require the highlighted data to be registered in Excel Cell “B2” and subsequent entries below “B2” for my study but could not because of the javascript.

    I am trying to collect Data from 1st July 1997 to 31st December 2022.

    Should you have doubt if I have any knowledge of VBA, please refer to the following working code.

    Thanking in Advance.

    Sub Get_Web_Data()
    Dim request As Object
    Dim response As String
    Dim html As New HTMLDocument
    Dim website As String
    Dim price As Variant
    Dim FstDate As Date
    Dim TheDate  As String
    Dim r As Long
    
    'String of initial date
    FstDate = CDate("1997-07-03")  '<<<<< Edit first date string if required or have entered via an input box?
    
    
        For r = 0 To 9400   ' r+2 will fill rows 2 to 9400
       
            TheDate = LCase(Format(FstDate + r, "yyyy%2Fmm%2Fdd"))
           
                website = "https://www.fourmilab.ch/cgi-bin/Solar?date=1&utc=" & TheDate & "+10%3A30%3A00&jd=2476948.34564&img=-k0&sys=-Sf&eyes=0&imgsize=320&orb=-b0&lat=1%B017&ns=North&lon=103%B051&ew=East&hlat=90%B0&hns=North&hlon=0%B0&elements="
                Set request = CreateObject("MSXML2.XMLHTTP")
                request.Open "GET", website, False
                request.send
                response = StrConv(request.responseBody, vbUnicode)
                html.body.innerHTML = response
                price = html.getElementsByTagName("pre")(0).innerText
                Cells(r + 2, "B") = price
       
        Next r
    End Sub
    Code (markup):
    I have also found the following code at https://chaosastrologer.com/js/dateBox.js

    /*
    dateBox.js 2002-01-09
    
    Author(s): Serge Ryabcuck, z555.com, Copyright 2002
    
    z555.com grants you a royalty free license to use or modify this
    software provided that this copyright notice appears on all copies.
    This software is provided "AS IS," without a warranty of any kind.
    */
    
    
    /* ToDo
    
    - Masks like dd/mm/yyyy, mm/dd/yyyy, etc.
    - Redraw of the object after change of object style properties.
    - Rewrite some object methods for conforming with initial idea
       and remoe direct HTML objects calls for properties duplicates
     
    */
    
    window.dbIE  = document.all ? true : false;                                // IE 4+
    window.dbDOM = (document.getElementById && ! document.all) ? true : false; // NS6, Mozilla, other DOM2 compartible browsers
    
    
    function dateBox(name, month, day, year) {
       this.name            = name;
       this.day             = day;
       this.month           = month;
       this.year            = year;
       //this.id;
       this.version         = "2.0.1 [Date Box; 20020109] ";
       this.type            = "dateBox";
       this.startYear       = 1860;
       this.endYear         = 2130;
       this.height          = 28;
       this.shortMonthWidth = 47;
       this.longMonthWidth  = 110;
       this.dayWidth        = 50;
       this.yearWidth       = 68;
       this.fontFamily      = 'Verdana, Arial, Helvetica, sans-serif';
       this.fontSize        = '11pt';
       this.dateBoxStyle    = 'long';
    
           
       this.shortMonth = [ 'Jan', 'Feb', 'Mar',
                           'Apr', 'May', 'Jun',
                           'Jul', 'Aug', 'Sep',
                           'Oct', 'Nov', 'Dec'
                         ];
    
       this.longMonth  = [ 'January', 'February', 'March',
                           'April', 'May', 'June',
                           'July', 'August', 'September',
                           'October', 'November', 'December'
                         ];
                                           
    // Other Properties;                                    
    
       //this.HTMLcontainer;
       //this.objForm;
       //this.objMonth;
       //this.objDay;
       //this.objYear;
           
    // Methods
           
       this.getName            = getName;
           
       this.setDay             = setDay;
       this.getDay             = getDay;
           
       this.setMonth           = setMonth;
       this.getMonth           = getMonth;
    
       this.setYear            = setYear;
       this.getYear            = getYear;
    
       this.getID              = getID;
           
       this.setStartYear       = setStartYear;
       this.getStartYear       = getStartYear;
       this.setEndYear         = setEndYear;
       this.getEndYear         = getEndYear;
           
       this.getDateBoxStyle    = getDateBoxStyle;
           
       this.setHeight          = setHeight;
       this.getHeight          = getHeight;
           
       this.setShortMonth      = setShortMonth;
       this.getShortMonth      = getShortMonth;
    
       this.setLongMonth       = setLongMonth;
       this.getLongMonth       = getLongMonth;
           
       this.getMonthWidth      = getMonthWidth;
           
       this.setDayWidth        = setDayWidth;
       this.getDayWidth        = getDayWidth;
           
       this.setYearWidth       = setYearWidth;
       this.getYearWidth       = getYearWidth;
    
       this.getMonthName       = getMonthName;
    
       this.setFontFamily      = setFontFamily;
       this.getFontFamily      = getFontFamily;
    
       this.setFontSize        = setFontSize;
       this.getFontSize        = getFontSize;
           
       this.setObjPointers     = setObjPointers;
       this.makeDateHTML       = makeDateHTML;
       this.printHTML          = printHTML;
       this.monthDays          = monthDays;
       this.limitList          = limitList
           
       this.getObjForm         = getObjForm;
       this.getObjDay          = getObjDay;
       this.getObjMonth        = getObjMonth;
       this.getObjYear         = getObjYear;
           
       this.getObjSelectedDate = getObjSelectedDate;
       this.setRawDate         = setRawDate;
       this.setObjDate         = setObjDate;
                   
    //Events
       this.onSelectDate       = onSelectDate;
    
       var curDate = new Date();
       if (!month) { this.month = curDate.getMonth()+1 };
       if (!day)   { this.day   = curDate.getDate() };
       if (!year)  {
           if (window.dbDOM) {            
               this.year  = curDate.getYear()+1900;
            } else {
               this.year  = curDate.getYear();
            }
       };
           
       if (!window.dateBoxes) window.dateBoxes = new Array();
       this.id=window.dateBoxes.length;
       window.dateBoxes[window.dateBoxes.length] = this;
           
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.getName()
    function getName() {
       return this.name;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.setDay()
    function setDay(day) {
       this.day=day;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.getDay()
    function getDay() {
       return this.day;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.setMonth()
    function setMonth(month) {
       this.month = month;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.getMonth()
    function getMonth() {
       return this.month;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.setYear()
    function setYear(year) {
       this.year=year;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.getYear()
    function getYear() {
       return this.year;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.getID()
    function getID() {
       return this.id;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.setStartYear()
    function setStartYear(year) {
       this.startYear = year;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.getStartYear()
    function getStartYear() {
       return this.startYear;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.setEndYear()
    function setEndYear(year) {
       this.endYear = year;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.getEndYear()
    function getEndYear() {
       return this.endYear;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.getDateBoxStyle()
    function getDateBoxStyle() {
       return this.dateBoxStyle;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.setShortMonth()
    function setShortMonth(monthArray) {
       this.shortMonth=monthArray;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.getShortMonth()
    function getShortMonth(monthIndex) {
       return this.shortMonth[monthIndex-1];
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.setLongMonth()
    function setLongMonth(monthArray) {
       this.longMonth=monthArray;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.getLongMonth()
    function getLongMonth(monthIndex) {
       return this.longMonth[monthIndex-1];
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.getMonthName()
    function getMonthName(monthIndex) {
       if (this.getDateBoxStyle() == 'short') {
          return this.getShortMonth(monthIndex);
       } else {
          return this.getLongMonth(monthIndex);
       }
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.setHeight()
    function setHeight(height) {
       this.height = height;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.getHeight()
    function getHeight() {
       return this.height;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.setShortMonthWidth()
    function setShortMonthWidth(width) {
       this.shortMonthWidth = width;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.setLongMonthWidth()
    function setLongMonthWidth(width) {
       this.longMonthWidth = width;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.getMonthWidth()
    function getMonthWidth() {
       if (this.getDateBoxStyle() == 'short') {
          return this.shortMonthWidth;
       } else {
          return this.longMonthWidth;
       }
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.setDayWidth()
    function setDayWidth(width) {
       this.dayWidth = width;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.getDayWidth()
    function getDayWidth() {
       return this.dayWidth;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.setYearWidth()
    function setYearWidth(width) {
       this.yearWidth = width;
    }              
    
    /////////////////////////////////////////////////////////////
    // dateBox.getYearWidth()
    function getYearWidth() {
       return this.yearWidth;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.setFontFamily()
    function setFontFamily(family) {
       this.fontFamily=family;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.getFontFamily()
    function getFontFamily() {
       return this.fontFamily;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.setFontSize()
    function setFontSize(size) {
       this.fontSize=size;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.getFontSize()
    function getFontSize() {
       return this.fontSize;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.getObjForm()
    function getObjForm() {
       return this.objForm;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.getObjDay()
    function getObjDay() {
       return this.objDay;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.getObjMonth()
    function getObjMonth() {
       return this.objMonth;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.getObjYear()
    function getObjYear() {
       return this.objYear;
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.makeDateHTML()
    function makeDateHTML() {
       var dateStr = "";
                   
       // Build Month
       dateStr += '<select name="' + this.getName() + 'Month' +
                  '" style="font-family : ' + this.getFontFamily() +
                  '; HEIGHT: ' + this.getHeight() + 'px; WIDTH:' +
                  this.getMonthWidth() + 'px; font-size: ' + this.getFontSize() +
                  ';" onChange="window.dateBoxes[' + this.getID() + '].onSelectDate()">';
    
       for (i=1; i<=12;i++) {
           if (this.getMonth() == i) {
              dateStr += '<option selected value=' + i + '>' + this.getMonthName(i);
           } else {
              dateStr += '<option value=' + i + '>' + this.getMonthName(i);
           }
       }
       dateStr += "</select>";
    
       // Build Day
       dateStr += '<select name="' + this.getName() + 'Day' +
                  '" style="font-family : ' + this.getFontFamily() +
                  '; HEIGHT: ' + this.getHeight() + 'px; WIDTH: ' +
                  this.getDayWidth() + 'px; font-size: ' + this.getFontSize() +
                  ';"  onChange="window.dateBoxes[' + this.getID() +
                  '].onSelectDate()">';
    
       for (i=1; i<=31; i++) {
           if (this.getDay() == i) {
               dateStr += '<option selected>'+i;
           } else {
             dateStr += '<option>'+i;
           }
       }
       dateStr += "</select>";
    
       // Build Year
       dateStr += '<select name="' + this.getName() + 'Year' +
                  '" style="font-family : ' + this.getFontFamily() + '; HEIGHT: ' +
                  this.getHeight() + 'px; WIDTH: ' + this.getYearWidth() +
                  'px; font-size: ' + this.getFontSize() +
                  ';" onChange="window.dateBoxes[' + this.getID() + '].onSelectDate()">';
                           
       for (i=this.getStartYear(); i<=this.getEndYear(); i++) {
            if (this.getYear() == i) {
               dateStr += '<option selected>' + i;
            } else {
               dateStr += '<option>' + i;
            }
       }
       dateStr += "</select>";
           
       this.HTMLcontainer=dateStr;    
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.printHTML()
    function printHTML() {
       document.write(this.HTMLcontainer);
       this.setObjPointers(document.forms[document.forms.length-1]);
       this.limitList(this.monthDays(this.getMonth(),this.getYear()));
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.setObjPointers()
    function setObjPointers(form) {
       this.objForm  = form;
       this.objDay   = eval("form."+this.getName()+"Day");
       this.objMonth = eval("form."+this.getName()+"Month");
       this.objYear  = eval("form."+this.getName()+"Year");
    }
    
    // How many days in the month?
    /////////////////////////////////////////////////////////////
    // dateBox.monthDays()
    function monthDays(month,year) {
       var day = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
       month--;
       if ((year % 4 == 0) && (month==1)) {
           if (year % 100 == 0) {
              if (year % 400 == 0) {
                  return 29;
              } else {
                  return 28;
              }
           } else {
              return 29;
           }  
      } else {
         return day[month];
      }
    }      
    
    // Event processor
    /////////////////////////////////////////////////////////////
    // dateBox.onSelectDate()
    function onSelectDate() {
       if (window.dbIE || window.dbDOM) {
          var objDay=this.getObjDay();
          var objYear=this.getObjYear();
          var objMonth=this.getObjMonth();
    
          yearVal=objYear.options[objYear.selectedIndex].text;
          monthVal=objMonth.options[objMonth.selectedIndex].value;
          this.limitList(this.monthDays(monthVal,yearVal));
    
          this.setDay(objDay.selectedIndex+1);
          this.setMonth(objMonth.selectedIndex+1);
          this.setYear(objYear.selectedIndex+this.startYear);
       }
    }
    
    //Rebuilds dropdown list of day options according to the month
    /////////////////////////////////////////////////////////////
    // dateBox.limitList()
    function limitList(length) {
       list=this.getObjDay();
       if (length<(list.selectedIndex+1)) {
          list.selectedIndex=length-1;
       }
       if (window.dbIE || window.dbDOM) {
          if (list.options.length<length) {
             for (var i=list.options.length+1; i<=length; i++) {
                 var oOption = document.createElement('OPTION');
                 if (window.dbIE) {
                    list.options.add(oOption);
                    oOption.innerText = i;
                    oOption.Value = i;
                 } else if (window.dbDOM) {    
                    oOption.text = ' '+i;
                    oOption.Value = i;
                    list.add(oOption,null);
                 }
              }
          } else if (list.options.length>length) {
             for (var i=list.options.length; i>=length; i--) {
                 list.remove(i);
             }              
          }
      }
    }
    
    // Convert form fields to Date object
    /////////////////////////////////////////////////////////////
    // dateBox.getObjSelectedDate()
    function getObjSelectedDate() {
       if (window.dbIE || window.dbDOM) {
          var objDay=this.getObjDay();
          var objYear=this.getObjYear();
          var objMonth=this.getObjMonth();
                   
          var day=objDay.options[objDay.selectedIndex].text;
          var month=objMonth.options[objMonth.selectedIndex].value-1;
          var year=objYear.options[objYear.selectedIndex].text;
                   
          var dateObj = new Date(year, month, day);
          return dateObj;
       }
    }
    
    // Set specified Date
    /////////////////////////////////////////////////////////////
    // dateBox.setRawDate()
    function setRawDate(month,day,year) {
       if (window.dbIE || window.dbDOM) {
          var objDay=this.getObjDay();
          var objYear=this.getObjYear();
          var objMonth=this.getObjMonth();
    
          this.limitList(this.monthDays(month,year));                  
          objDay.selectedIndex=day-1;
          objMonth.selectedIndex=month-1;
          objYear.selectedIndex=year-this.startYear;
       }
    }
    
    /////////////////////////////////////////////////////////////
    // dateBox.setObjDate()
    function setObjDate(date){
       if (window.dbIE || window.dbDOM) {
           var month = date.getMonth()+1;
           var day   = date.getDate();
           if (window.dbDOM) {            
              var year  = date.getYear()+1900;
           } else {
              var year  = date.getYear();
           }
           this.setRawDate(month,day,year);
       }
    }
    Code (markup):
    I have also found another at https://www.chaosastrologer.com/cf_scripts/scripts/cfform.js

    /*ADOBE SYSTEMS INCORPORATED
    Copyright 2012 Adobe Systems Incorporated
    All Rights Reserved.
    
    NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance with the
    terms of the Adobe license agreement accompanying it.  If you have received this file from a
    source other than Adobe, then your use, modification, or distribution of it requires the prior
    written permission of Adobe.*/
    var _CF_error_messages=new Array();
    var _CF_error_fields=new Object();
    var _CF_FirstErrorField=null;
    var _CF_submit_status=new Array();
    _CF_signalLoad=function(){
    _CF_loaded=1;
    };
    _CF_onError=function(_91c,_91d,_91e,_91f){
    if(_CF_error_fields[_91d]==null){
    if(_CF_FirstErrorField==null){
    _CF_FirstErrorField=_91d;
    }
    _CF_error_exists=true;
    _CF_error_fields[_91d]=_91f;
    _CF_error_messages[_CF_error_messages.length]=_91f;
    }
    };
    _CF_onErrorAlert=function(_920){
    var _921="";
    for(var i=0;i<_920.length;i++){
    _921+=_920[i]+"\n";
    }
    alert(_921);
    return false;
    };
    updateHiddenValue=function(val,form,name){
    if(form==null||form==""){
    form=0;
    }
    if(document.forms[form]==null||document.forms[form][name]==null){
    return;
    }
    document.forms[form][name].value=val;
    };
    _CF_hasValue=function(obj,_927,_928){
    if(_927=="TEXT"||_927=="FILE"||_927=="PASSWORD"||_927=="CFTEXTAREA"||_927=="TEXTAREA"||_927=="CFTEXTINPUT"||_927=="DATEFIELD"){
    if(obj.value.length==0){
    return false;
    }else{
    if(_928){
    str=obj.value.replace(/^\s+/,"").replace(/\s+$/,"");
    if(str.length==0){
    return false;
    }
    }
    }
    return true;
    }else{
    if(_927=="SELECT"){
    for(i=0;i<obj.length;i++){
    if(obj.options[i].selected&&obj.options[i].value.length>0){
    return true;
    }
    }
    return false;
    }else{
    if(_927=="SINGLE_VALUE_RADIO"||_927=="SINGLE_VALUE_CHECKBOX"){
    if(obj.checked){
    return true;
    }else{
    return false;
    }
    }else{
    if(_927=="RADIO"||_927=="CHECKBOX"){
    if(obj.length==undefined&&obj.checked){
    return true;
    }else{
    for(i=0;i<obj.length;i++){
    if(obj[i].checked){
    return true;
    }
    }
    }
    return false;
    }else{
    if(_927=="CFTREE"){
    if(obj["value"].length>0){
    return true;
    }else{
    return false;
    }
    }else{
    if(_927=="RICHTEXT"){
    var _929=FCKeditorAPI.GetInstance(obj.id);
    var val=_929.GetXHTML();
    if(val.length==0){
    return false;
    }else{
    if(_928){
    str=val.replace(/^\s+/,"").replace(/\s+$/,"");
    if(str.length==0){
    return false;
    }
    }
    return true;
    }
    }else{
    return true;
    }
    }
    }
    }
    }
    }
    };
    _CF_checkdate=function(_92b,_92c){
    _92b=_92b.replace(/^\s+/,"").replace(/\s+$/,"");
    _92b=_92b=_92b.replace(/{d \'/,"").replace(/'}/,"");
    if(_92c){
    if(_92b.length==0){
    return false;
    }
    }else{
    if(_92b.length==0){
    return true;
    }
    }
    if(_92b.length==0){
    return true;
    }
    isplit=_92b.indexOf("/");
    splitchr="/";
    if(isplit==-1){
    isplit=_92b.indexOf(".");
    splitchr=".";
    }
    if(isplit==-1){
    isplit=_92b.indexOf("-");
    splitchr="-";
    }
    if(isplit==-1||isplit==_92b.length){
    return false;
    }
    var _92d=_92b.substring(0,isplit);
    if(_92d.length==4){
    sYear=_92b.substring(0,isplit);
    isplit=_92b.indexOf(splitchr,isplit+1);
    if(isplit==-1||(isplit+1)==_92b.length){
    return false;
    }
    sMonth=_92b.substring((sYear.length+1),isplit);
    sDay=_92b.substring(isplit+1);
    }else{
    sMonth=_92b.substring(0,isplit);
    isplit=_92b.indexOf(splitchr,isplit+1);
    if(isplit==-1||(isplit+1)==_92b.length){
    return false;
    }
    sDay=_92b.substring((sMonth.length+1),isplit);
    sYear=_92b.substring(isplit+1);
    }
    if((sDay.length==0)||(sMonth.length==0)||(sYear.length==0)){
    return false;
    }
    if(!_CF_checkinteger(sMonth)){
    return false;
    }else{
    if(!_CF_checkrange(sMonth,1,12)){
    return false;
    }else{
    if(!_CF_checkinteger(sYear)){
    return false;
    }else{
    if(sYear.length!=1&&sYear.length!=2&&sYear.length!=4){
    return false;
    }else{
    if(!_CF_checkrange(sYear,0,9999)){
    return false;
    }else{
    if(!_CF_checkinteger(sDay)){
    return false;
    }else{
    if(!_CF_checkday(sYear,sMonth,sDay)){
    return false;
    }else{
    return true;
    }
    }
    }
    }
    }
    }
    }
    };
    _CF_checkeurodate=function(_92e,_92f){
    _92e=_92e.replace(/^\s+/,"").replace(/\s+$/,"");
    _92e=_92e=_92e.replace(/{d \'/,"").replace(/'}/,"");
    if(_92f){
    if(_92e.length==0){
    return false;
    }
    }else{
    if(_92e.length==0){
    return true;
    }
    }
    isplit=_92e.indexOf("/");
    splitchr="/";
    if(isplit==-1){
    isplit=_92e.indexOf(".");
    splitchr=".";
    }
    if(isplit==-1){
    isplit=_92e.indexOf("-");
    splitchr="-";
    }
    if(isplit==-1||isplit==_92e.length){
    return false;
    }
    var _930=_92e.substring(0,isplit);
    if(_930.length==4){
    sYear=_92e.substring(0,isplit);
    isplit=_92e.indexOf(splitchr,isplit+1);
    if(isplit==-1||(isplit+1)==_92e.length){
    return false;
    }
    sMonth=_92e.substring((sYear.length+1),isplit);
    sDay=_92e.substring(isplit+1);
    }else{
    sDay=_92e.substring(0,isplit);
    isplit=_92e.indexOf(splitchr,isplit+1);
    if(isplit==-1||(isplit+1)==_92e.length){
    return false;
    }
    sMonth=_92e.substring((sDay.length+1),isplit);
    sYear=_92e.substring(isplit+1);
    }
    if(!_CF_checkinteger(sMonth)){
    return false;
    }else{
    if(!_CF_checkrange(sMonth,1,12)){
    return false;
    }else{
    if(!_CF_checkinteger(sYear)){
    return false;
    }else{
    if(!_CF_checkrange(sYear,0,null)){
    return false;
    }else{
    if(!_CF_checkinteger(sDay)){
    return false;
    }else{
    if(!_CF_checkday(sYear,sMonth,sDay)){
    return false;
    }else{
    return true;
    }
    }
    }
    }
    }
    }
    };
    _CF_checkday=function(_931,_932,_933){
    maxDay=31;
    if(_932==4||_932==6||_932==9||_932==11){
    maxDay=30;
    }else{
    if(_932==2){
    if(_931%4>0){
    maxDay=28;
    }else{
    if(_931%100==0&&_931%400>0){
    maxDay=28;
    }else{
    maxDay=29;
    }
    }
    }
    }
    return _CF_checkrange(_933,1,maxDay);
    };
    _CF_checkinteger=function(_934,_935){
    _934=_934.replace(/^\s+/,"").replace(/\s+$/,"");
    _934=_934.replace(/[$£¥€,~+]?/g,"");
    if(_935){
    if(_934.length==0){
    return false;
    }
    }else{
    if(_934.length==0){
    return true;
    }
    }
    var _936=".";
    var _937=_934.indexOf(_936);
    if(_937==-1){
    return _CF_checknumber(_934);
    }else{
    return false;
    }
    };
    _CF_numberrange=function(_938,_939,_93a,_93b){
    if(_93b){
    if(_938.length==0){
    return false;
    }
    }else{
    if(_938.length==0){
    return true;
    }
    }
    if(_939!=null){
    if(_938<_939){
    return false;
    }
    }
    if(_93a!=null){
    if(_938>_93a){
    return false;
    }
    }
    return true;
    };
    _CF_checknumber=function(_93c,_93d){
    var _93e=" .+-0123456789";
    var _93f=" .0123456789";
    var _940;
    var _941=false;
    var _942=false;
    var _943=false;
    _93c=_93c.replace(/^\s+/,"").replace(/\s+$/,"");
    _93c=_93c.replace(/[$£¥€,~+]?/g,"");
    if(_93d){
    if(_93c.length==0){
    return false;
    }
    }else{
    if(_93c.length==0){
    return true;
    }
    }
    _940=_93e.indexOf(_93c.charAt(0));
    if(_940==1){
    _941=true;
    }else{
    if(_940<1){
    return false;
    }
    }
    for(var i=1;i<_93c.length;i++){
    _940=_93f.indexOf(_93c.charAt(i));
    if(_940<0){
    return false;
    }else{
    if(_940==1){
    if(_941){
    return false;
    }else{
    _941=true;
    }
    }else{
    if(_940==0){
    if(_941||_943){
    _942=true;
    }
    }else{
    if(_942){
    return false;
    }else{
    _943=true;
    }
    }
    }
    }
    }
    return true;
    };
    _CF_checkrange=function(_945,_946,_947,_948){
    _945=_945.replace(/^\s+/,"").replace(/\s+$/,"");
    if(_948){
    if(_945.length==0){
    return false;
    }
    }else{
    if(_945.length==0){
    return true;
    }
    }
    if(!_CF_checknumber(_945)){
    return false;
    }else{
    return (_CF_numberrange((eval(_945)),_946,_947));
    }
    return true;
    };
    _CF_checktime=function(_949,_94a){
    _949=_949.replace(/^\s+/,"").replace(/\s+$/,"");
    _949=_949.replace(/\s+:\s+/,":");
    _949=_949=_949.replace(/{t \'/,"").replace(/'}/,"");
    if(_94a){
    if(_949.length==0){
    return false;
    }
    }else{
    if(_949.length==0){
    return true;
    }
    }
    var _94b=_CF_checkregex(_949,/^((([0-1]?\d)|(2[0-3])):[0-5]?\d)?(:[0-5]?\d)? ?([AP]M|[AP]m|[ap]m|[ap]M)?$/,_94a);
    return _94b;
    };
    _CF_checkphone=function(_94c,_94d){
    _94c=_94c.replace(/^\s+/,"").replace(/\s+$/,"");
    if(_94d){
    if(_94c.length==0){
    return false;
    }
    }else{
    if(_94c.length==0){
    return true;
    }
    }
    if(_94c.length==0){
    return true;
    }
    return _CF_checkregex(_94c,/^(((1))?[ ,\-,\.]?([\\(]?([1-9][0-9]{2})[\\)]?))?[ ,\-,\.]?([^0-1]){1}([0-9]){2}[ ,\-,\.]?([0-9]){4}(( )((x){0,1}([0-9]){1,5}){0,1})?$/,_94d);
    };
    _CF_checkzip=function(_94e,_94f){
    _94e=_94e.replace(/^\s+/,"").replace(/\s+$/,"");
    if(_94f){
    if(_94e.length==0){
    return false;
    }
    }else{
    if(_94e.length==0){
    return true;
    }
    }
    return _CF_checkregex(_94e,/^([0-9]){5,5}$|(([0-9]){5,5}(-| ){1}([0-9]){4,4}$)/,_94f);
    };
    _CF_checkcreditcard=function(_950,_951){
    _950=_950.replace(/^\s+/,"").replace(/\s+$/,"");
    if(_951){
    if(_950.length==0){
    return false;
    }
    }else{
    if(_950.length==0){
    return true;
    }
    }
    if(_950.length==0){
    return true;
    }
    var _952=" -";
    var _953="";
    var _954;
    for(var i=0;i<_950.length;i++){
    _954=_952.indexOf(_950.charAt(i));
    if(_954<0){
    _953+=_950.substring(i,(i+1));
    }
    }
    if(_953.length<13||_953.length>19){
    return false;
    }
    if(_953.charAt(0)=="+"){
    return false;
    }
    if(!_CF_checkinteger(_953)){
    return false;
    }
    var _956=_953.length%2==1?false:true;
    var _957=0;
    var _958;
    for(var i=0;i<_953.length;i++){
    _958=eval(_953.charAt(i));
    if(_956){
    _958*=2;
    _957+=(_958%10);
    if((_958/10)>=1){
    _957++;
    }
    _956=false;
    }else{
    _957+=_958;
    _956=true;
    }
    }
    return (_957%10)==0?true:false;
    };
    _CF_checkssn=function(_959,_95a){
    _959=_959.replace(/^\s+/,"").replace(/\s+$/,"");
    if(_95a){
    if(_959.length==0){
    return false;
    }
    }else{
    if(_959.length==0){
    return true;
    }
    }
    return _CF_checkregex(_959,/^[0-9]{3}(-| )[0-9]{2}(-| )[0-9]{4}$/,_95a);
    };
    _CF_checkEmail=function(_95b,_95c){
    _95b=_95b.replace(/^\s+/,"").replace(/\s+$/,"");
    if(_95c){
    if(_95b.length==0){
    return false;
    }
    }else{
    if(_95b.length==0){
    return true;
    }
    }
    return _CF_checkregex(_95b,/^[a-zA-Z_0-9-'\+~]+(\.[a-zA-Z_0-9-'\+~]+)*@([a-zA-Z_0-9-]+\.)+[a-zA-Z]*$/,_95c);
    };
    _CF_checkURL=function(_95d,_95e){
    _95d=_95d.replace(/^\s+/,"").replace(/\s+$/,"");
    if(_95e){
    if(_95d.length==0){
    return false;
    }
    }else{
    if(_95d.length==0){
    return true;
    }
    }
    return _CF_checkregex(_95d.toLowerCase(),/^((http|https|ftp|file)\:\/\/([a-zA-Z0-0]*:[a-zA-Z0-0]*(@))?[a-zA-Z0-9-\.]+(\.[a-zA-Z]{2,3})?(:[a-zA-Z0-9]*)?\/?([a-zA-Z0-9-\._\?\,\'\/\+&amp;%\$#\=~])*)|((mailto)\:[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9]*)|((news)\:[a-zA-Z0-9\.]*)$/,_95e);
    };
    _CF_checkUUID=function(_95f,_960){
    _95f=_95f.replace(/^\s+/,"").replace(/\s+$/,"");
    if(_960){
    if(_95f.length==0){
    return false;
    }
    }else{
    if(_95f.length==0){
    return true;
    }
    }
    return _CF_checkregex(_95f,/[A-Fa-f0-9]{8,8}-[A-Fa-f0-9]{4,4}-[A-Fa-f0-9]{4,4}-[A-Fa-f0-9]{16,16}/,_960);
    };
    _CF_checkGUID=function(_961,_962){
    _961=_961.replace(/^\s+/,"").replace(/\s+$/,"");
    if(_962){
    if(_961.length==0){
    return false;
    }
    }else{
    if(_961.length==0){
    return true;
    }
    }
    return _CF_checkregex(_961,/[A-Fa-f0-9]{8,8}-[A-Fa-f0-9]{4,4}-[A-Fa-f0-9]{4,4}-[A-Fa-f0-9]{4,4}-[A-Fa-f0-9]{12,12}/,_962);
    };
    _CF_checkBoolean=function(_963,_964){
    _963=_963.replace(/^\s+/,"").replace(/\s+$/,"");
    if(_964){
    if(_963.length==0){
    return false;
    }
    }else{
    if(_963.length==0){
    return true;
    }
    }
    if(_963.toUpperCase()=="TRUE"||_963.toUpperCase()=="YES"||(_CF_checknumber(_963)&&_963!="0")){
    return true;
    }else{
    if(_963.toUpperCase()=="FALSE"||_963.toUpperCase()=="NO"||_963=="0"){
    return true;
    }else{
    return false;
    }
    }
    };
    _CF_setFormParam=function(_965,_966,_967){
    var _968="document['"+_965+"']['"+_966+"']";
    var obj=eval(_968);
    if(obj==undefined){
    return false;
    }else{
    obj.value=_967;
    return true;
    }
    };
    _CF_checkregex=function(_96a,_96b,_96c){
    if(_96c){
    if(_96a.length==0){
    return false;
    }
    }else{
    if(_96a.length==0){
    return true;
    }
    }
    return _96b.test(_96a);
    };
    Code (markup):
     

    Attached Files:

    gurunathblessings, May 6, 2022 IP
  2. Rammina

    Rammina Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    I usually use Axios to connect to API endpoints to retrieve data.

    It's a really useful library, have you tried using npm?
     
    Rammina, May 9, 2022 IP
  3. gurunathblessings

    gurunathblessings Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    No.

    I am new to what you are suggesting.

    I would appreciate if you could provide more information or guideline.

    Thanks.
     
    Last edited by a moderator: May 9, 2022
    gurunathblessings, May 9, 2022 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,641
    Likes Received:
    4,486
    Best Answers:
    123
    Trophy Points:
    665
    #4
    Technically you can use axios like this:
    let url = "https://www.chaosastrology.com/chaos1/reports/runastro_c.cgi";
    
    axios
      .post(url, {
        date1Month: "5",
        date1Day: "10",
        date1Year: "2022",
        zone: "0",
        timehour: "00",
        timemin: "00",
        ampm: "am",
        longdeg: "000",
        longmin: "00",
        ew: "W",
        latdeg: 51,
        latmin: 29,
        ns: "N",
        Submit: "Click Once"
      })
      .then(function (response) {
        console.log(response);
      })
      .catch(function (error) {
        console.log(error);
      });
    Code (JavaScript):
    but the result is an error with this:

    "xsrfCookieName":"XSRF-TOKEN",
    "xsrfHeaderName":"X-XSRF-TOKEN"
    Code (markup):
    What that means is that the site owners haven't set up their site to allow external use of their API. There's no way to get around that without going to the page and manually copying it.

    You could contact them and ask for your site to be allowed access or find another source of the data.
     
    sarahk, May 9, 2022 IP
  5. Rammina

    Rammina Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    Yeah, could be a security feature or issue, where those only with a specific token or permission could access the API.

    There are plenty of sites/APIs that do that.
     
    Rammina, May 10, 2022 IP
  6. gurunathblessings

    gurunathblessings Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #6
    I have already written to them but no response from them.

    I told them that I will even pay them for the data.

    Anyway Thanks.
     
    gurunathblessings, May 10, 2022 IP