steverob / aurs

Anna University Results Scrapper App
0 stars 0 forks source link

#FIXME its total messs! #3

Closed debtBot closed 8 years ago

debtBot commented 8 years ago

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

debtBot commented 8 years ago

This issue was possibly resolved by 696ef6d587725caa166a5abaed7d292c5cd9187a