Git Product home page Git Product logo

aurs's People

Contributors

pokle avatar steverob avatar wheresalice avatar

Watchers

 avatar  avatar

aurs's Issues

#TODO new comment

#TODO new comment

Context

  #TODO new comment
    def generate_reg_nos
      reg=@start
      while reg!=@ending+1
        @reg_nos << reg
        reg+=1
      end
    end

    def process_url
      @url.gsub!(File.extname(@url),".aspx")
    end

  public

  def scrape
    puts @reg_nos.inspect
    puts @url
    @reg_nos.each do |reg_no|
      url=@url+"?htno="+reg_no.to_s
      puts url
      doc=Nokogiri::HTML(open(url))
      puts doc
      cells=doc.css("td")
      puts cells


Auto-opened by DebTrakr

#FIXME comment

#FIXME comment

Context

  #FIXME comment
  def initialize(url,start,ending)
    @url=url
    @start=start.to_i
    @ending=ending.to_i
    @count=0
    @reg_nos=Array.new
    @results=Hash.new
    generate_reg_nos
    process_url
  end

  protected
    def generate_reg_nos

Auto-opened by DebTrakr

#TODO we need some docs for this

#TODO we need some docs for this

Context

#TODO we need some docs for this
class ChennaiResults
  attr_accessor :results

  def initialize(url,start,ending)
    @url=url
    @start=start.to_i
    @ending=ending.to_i

Auto-opened by DebTrakr

#FIXME its a total and complete mess!

#FIXME its a total and complete mess!

Context

      #FIXME its a total and complete mess!
      cells.length.times do |i|
        if cells[i].text==" Hall Ticket No "
          next
        elsif cells[i-1].text==" Hall Ticket No "
          next
        elsif cells[i-1].text==" Course "
          next
        elsif cells[i].text==" Name "
          @results[reg_no][:name]=cells[i+1].text
          next
        elsif cells[i].text==" Course " || cells[i].text=~ /B.E.(.*)/ || cells[i].text=="Marks Details" || cells[i].text=="Subject" || cells[i].text=="Grade" || cells[i].text=="Status"
          next
        elsif cells[i].text=="PASS" || cells[i].text=="RA" || cells[i].text=="A"|| cells[i].text=="B"|| cells[i].text=="C"|| cells[i].text=="D"|| cells[i].text=="E"|| cells[i].text=="S"|| cells[i].text=="U"|| cells[i].text=~ /WH(.*)/ || cells[i].text=="AB"|| cells[i].text=="W"|| cells[i].text=="SA" || cells[i].text=="SE"|| cells[i].text=="A.B"|| cells[i].text=="I"|| cells[i].text=="WD"|| cells[i].text==" "|| cells[i].text=="BRK"
          next
        elsif cells[i+1].text==" Course "
          next
        else
          @results[reg_no][:grades][cells[i].text]={:grade=>cells[i+1].text,:result=>cells[i+2].text}
        end
      end
      if @results[reg_no][:name].nil?
        @results.delete(reg_no)
      end
      @count+=1
      puts @results[reg_no]
    end
  end

end

Auto-opened by DebTrakr

#FIXME its a total complete mess!

#FIXME its a total complete mess!

Context

      #FIXME its a total complete mess!
      cells.length.times do |i|
        if cells[i].text==" Hall Ticket No "
          next
        elsif cells[i-1].text==" Hall Ticket No "
          next
        elsif cells[i-1].text==" Course "
          next
        elsif cells[i].text==" Name "
          @results[reg_no][:name]=cells[i+1].text
          next
        elsif cells[i].text==" Course " || cells[i].text=~ /B.E.(.*)/ || cells[i].text=="Marks Details" || cells[i].text=="Subject" || cells[i].text=="Grade" || cells[i].text=="Status"
          next
        elsif cells[i].text=="PASS" || cells[i].text=="RA" || cells[i].text=="A"|| cells[i].text=="B"|| cells[i].text=="C"|| cells[i].text=="D"|| cells[i].text=="E"|| cells[i].text=="S"|| cells[i].text=="U"|| cells[i].text=~ /WH(.*)/ || cells[i].text=="AB"|| cells[i].text=="W"|| cells[i].text=="SA" || cells[i].text=="SE"|| cells[i].text=="A.B"|| cells[i].text=="I"|| cells[i].text=="WD"|| cells[i].text==" "|| cells[i].text=="BRK"
          next
        elsif cells[i+1].text==" Course "
          next
        else
          @results[reg_no][:grades][cells[i].text]={:grade=>cells[i+1].text,:result=>cells[i+2].text}
        end
      end
      if @results[reg_no][:name].nil?
        @results.delete(reg_no)
      end
      @count+=1
      puts @results[reg_no]
    end
  end

end

Auto-opened by DebTrakr

#FIXME its total messs!

#FIXME its total messs!

Context

      #FIXME its total messs!
      cells.length.times do |i|
        if cells[i].text==" Hall Ticket No "
          next
        elsif cells[i-1].text==" Hall Ticket No "
          next
        elsif cells[i-1].text==" Course "
          next
        elsif cells[i].text==" Name "
          @results[reg_no][:name]=cells[i+1].text
          next
        elsif cells[i].text==" Course " || cells[i].text=~ /B.E.(.*)/ || cells[i].text=="Marks Details" || cells[i].text=="Subject" || cells[i].text=="Grade" || cells[i].text=="Status"
          next
        elsif cells[i].text=="PASS" || cells[i].text=="RA" || cells[i].text=="A"|| cells[i].text=="B"|| cells[i].text=="C"|| cells[i].text=="D"|| cells[i].text=="E"|| cells[i].text=="S"|| cells[i].text=="U"|| cells[i].text=~ /WH(.*)/ || cells[i].text=="AB"|| cells[i].text=="W"|| cells[i].text=="SA" || cells[i].text=="SE"|| cells[i].text=="A.B"|| cells[i].text=="I"|| cells[i].text=="WD"|| cells[i].text==" "|| cells[i].text=="BRK"
          next
        elsif cells[i+1].text==" Course "
          next
        else
          @results[reg_no][:grades][cells[i].text]={:grade=>cells[i+1].text,:result=>cells[i+2].text}
        end
      end
      if @results[reg_no][:name].nil?
        @results.delete(reg_no)
      end
      @count+=1
      puts @results[reg_no]
    end
  end

end

Auto-opened by DebTrakr

#FIXME this is too compelx man!

#FIXME this is too compelx man!

Context

        #FIXME this is too compelx man!
        elsif t.text=='Name'
          @results[reg_no][:name]=data[i+1].text
        elsif t.text=="PASS" || t.text=="RA" || t.text=="A"|| t.text=="B"|| t.text=="C"|| t.text=="D"|| t.text=="E"|| t.text=="S"|| t.text=="U"|| t.text=~ /WH(.*)/ || t.text=="AB"|| t.text=="W"|| t.text=="SA" || t.text=="SE"|| t.text=="A.B"|| t.text=="I"|| t.text=="WD"|| t.text==" "|| t.text=="BRK"|| t.text==""
          next
        else
          @results[reg_no][:grades][data[i].text]={:grade=>data[i+1].text,:result=>data[i+2].text}
        end
      end
      if @results[reg_no][:name].nil?
        @results.delete(reg_no)
      end
      @count+=1
    end
  end

end

Auto-opened by DebTrakr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.