mwunsch / prism Goto Github PK
View Code? Open in Web Editor NEWA Ruby microformat parser and HTML toolkit powered by Nokogiri
License: MIT License
A Ruby microformat parser and HTML toolkit powered by Nokogiri
License: MIT License
When a single telephone number is in an hcard the vcard outputs an error since 'phone' is an unknown variable.
Example: prism --hcard http://www.aldenta.com/
In hcard.rb line 117:
@vCard += "\x0D\x0ATEL#{type_value_vcard(phone)}"
should be changed to:
@vCard += "\x0D\x0ATEL#{type_value_vcard(tel)}"
Just another bug related with hCalendar,
Prism.find('http://iansrobinson.com/')
does not find the hCalendar, but mofo and Firefox Operator do.
Prism.find 'http://verselogic.net/' #=> last 2 objects are strings
I guess this is a bug. Using prism-0.1.0 gem
From an irb session :-
vcard = Prism.find(open('<some_linkedin_profile>'), :hcard)
vcard.second # Returns Prism::Microformat::HCard object -> {:title=>"Title_string", :org=>{:organization_name=>"The Organization Name"}}
current = vcard.second[:org] # This object's type is an anonymous class
current.to_yaml
TypeError: can't dump anonymous class Class
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:6:in `to_yaml'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:41:in `node_export'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:41:in `add'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:41:in `to_yaml'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:40:in `each'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:40:in `to_yaml'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:39:in `map'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:39:in `to_yaml'
from /usr/lib64/ruby/1.8/yaml.rb:391:in `call'
from /usr/lib64/ruby/1.8/yaml.rb:391:in `emit'
from /usr/lib64/ruby/1.8/yaml.rb:391:in `quick_emit'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:38:in `to_yaml'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:18:in `node_export'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:18:in `add'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:18:in `to_yaml'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:17:in `each'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:17:in `to_yaml'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:16:in `map'
from /usr/lib64/ruby/1.8/yaml/rubytypes.rb:16:in `to_yaml'
from /usr/lib64/ruby/1.8/yaml.rb:391:in `call'
from /usr/lib64/ruby/1.8/yaml.rb:391:in `emit'
from /usr/lib64/ruby/1.8/yaml.rb:391:in `quick_emit'
We are working around this issue by doing an inspect on current and then serializing it. We wanted to know whether this issue is something that can be fixed at your end.
/home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/microformat/hcard.rb:60:in []': can't convert String into Integer (TypeError) from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/microformat/hcard.rb:60 from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism.rb:102:in
call'
from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism.rb:102:in extract_from' from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism.rb:109:in
parse'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in collect' from /home/test_prism/vendor/gems/ruby/1.8/gems/nokogiri-1.4.2/lib/nokogiri/xml/node.rb:402:in
call'
from /home/test_prism/vendor/gems/ruby/1.8/gems/nokogiri-1.4.2/lib/nokogiri/xml/node.rb:402:in each' from /home/test_prism/vendor/gems/ruby/1.8/gems/nokogiri-1.4.2/lib/nokogiri/xml/node.rb:401:in
each'
from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism.rb:109:in collect' from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism.rb:109:in
parse'
from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/posh/base.rb:144:in get_properties' from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/posh/base.rb:140:in
each_pair'
from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/posh/base.rb:140:in get_properties' from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/posh/base.rb:175:in
to_h'
from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/posh/base.rb:195:in empty?' from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/posh/base.rb:148:in
get_properties'
from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/posh/base.rb:147:in reject' from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/posh/base.rb:147:in
get_properties'
from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/posh/base.rb:175:in to_h' from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/posh/base.rb:165:in
[]'
from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/posh/base.rb:92:in fn' from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/lib/prism/microformat/hcard.rb:99:in
to_vcard'
from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/bin/prism:95
from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/bin/prism:80:in parse_microformats' from /home/test_prism/vendor/gems/ruby/1.8/gems/prism-0.1.0/bin/prism:95 from bin/prism:3:in
load'
from bin/prism:3
When we instruct Gem bundle to use 1.4.1 everything works fine ;) Might be better off declaring which version of the dependency you need.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.