Closed ansvver closed 9 years ago
The comments.sh
needs xidel to parse the html and grabe the content without any HTML tags.
The comments.sh
would check xidel
whether installed or not in your Linux box, if not, it will download the Universal Linux: 64 Bit Version . I supposed people would use the 64bits Linux instead 32bits Linux.
So, accroding your post, i think you might use the 32bits Linux, so that the xidel binary cannot be executed as it is 64bits version.
Would you please run uname -a
to check your system, and post the result here?
Thanks again for your quick answer! You are right, it's the 32bits machine! Just a little pity, Thanks Haoel again!
[root@localhost leetcode]# uname -a Linux localhost.localdomain 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:12 EDT 2008 i686 i686 i386 GNU/Linux
Thanks for comformation, I will fix my script soon....
Brilliant!
Actually, the code fix is 6a1d68cd2c5d08577ba7b5b8defce0c87707f4a5
It works perfectly now in my 32-bits machine! Thanks.
Hello Haoel! At very beginning, I really like what comments.sh does, thanks. I got some problems with the scripts. Following is the messages and info. Do you have any advice for it?
[root@localhost leetcode]# ./comments.sh https://oj.leetcode.com/problems/largest-number/ largestNumber.cpp ./comments.sh: line 80: /usr/bin/xidel: cannot execute binary file LargestNumber.cpp updated !
line 80: xidel ${leetcode_url} -q -e "css('div.question-content')" | \ xidel ${leetcodeurl} -q -e "css('div.question-content')" | \ grep -v ' ' |sed '/^$/N;/^\n$/D' | \ sed 's/^/ * /' | sed "1i/$(printf '%.0s' {0..80}) \n * " | \ sed "\$a \ $(printf '%.0s' {0..80})_/\n" > /tmp/tmp.txt
[root@localhost leetcode]# ls -t LargestNumber.cpp xidel comments.sh [root@localhost leetcode]# ls xidel/ changelog install.sh readme.txt xidel xidel-0.8.4.linux64.tar.gz
Following is what the scripts gen: // Source : https://oj.leetcode.com/problems/largest-number/ // Author : Edward Wang // Date : 2015-02-04