I've been enjoying Learning with Learn. This lesson was useful as a chance to get used to putting the pieces together. I created a gem to extract the current local weather from weather.com. Avi's video helped a lot here and it was great to see how one can think on the fly and try things out in this context. And I learned from watching him put to together methods which helps underscore how the pieces work together. I liked laying down a concept for the gem in notes and stepping back for a second to think through the aims of the gem.
I think I chose a difficult site for this project as it uses angular js. I really struggled with scraping and needed online chat help on several occasions. On the recommendation of Adam King (ADAMKING0126), I looked into Phantomjs to scrape the text I am interested in. I installed it on my computer and also followed some online instructions for installing into my gem via command line. Unfortunately, after a rather long install I received a number of messages about Phantomjs not being able to be installed on my system.
1 warning generated.
g++ -c -pipe -fvisibility=hidden -O2 -arch i386 -Wall -W -DHAVE_CONFIG_H -DHAVE_FCNTL_H -DHAVE_STDARG_H -DHAVE_STDINT_H -DHAVE_UNISTD_H -DUSE_UTF8 -DSTATIC_BUILD -DQCOMMANDLINE_STATIC -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -Iqt/mkspecs/macx-g++ -I. -Iqt/include/QtCore -Iqt/include/QtNetwork -Iqt/include/QtGui -Iqt/include/QtWebKit -Iqt/include -Igif -Imongoose -Ilinenoise/src -Iqcommandline -Ibreakpad/src -I. -o moc_config.o moc_config.cpp
In file included from moc_config.cpp:10:
In file included from ./config.h:34:
In file included from qt/include/QtCore/QString:1:
In file included from qt/include/QtCore/qstring.h:1:
In file included from qt/include/QtCore/../../src/corelib/tools/qstring.h:45:
In file included from qt/include/QtCore/qchar.h:1:
In file included from qt/include/QtCore/../../src/corelib/tools/qchar.h:45:
In file included from qt/include/QtCore/qglobal.h:1:
qt/include/QtCore/../../src/corelib/global/qglobal.h:372:6: warning: "This version of Mac OS X is
unsupported" [-W#warnings]
warning "This version of Mac OS X is unsupported"
And a message that I cannot load phantomjs:
// ♥ ./bin/console
/Users/peterjacobson/Development/code/weather_now/lib/weather_now.rb:4:in require': cannot load such file -- phantomjs (LoadError)
from /Users/peterjacobson/Development/code/weather_now/lib/weather_now.rb:4:in
from ./bin/console:4:in require'
from ./bin/console:4:in
I don't feel great about stopping here but I did spend several days on it and I did get something out of using Nokogiri, conceptualizing a gem, working with requirements and building methods. The next steps would be to work on zipcode search functionality and add something like a 5 day forecast.