Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fixtures/test_techcrunch1.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"href": "http://money.cnn.com/popups/2006/biz2/peoplewhodontmatter/frameset.exclude.html"
},
{
"text": "<img src=\"http://tctechcrunch2011.files.wordpress.com/2011/08/screen-shot-2011-08-13-at-6-43-20-pm1.png?w=620&amp;h=393\" alt=\"\" title=\"Screen Shot 2011-08-13 at 6.43.20 PM\" width=\"620\" height=\"393\" class=\"alignnone size-full wp-image-406259\">",
"text": "<img src=\"http://tctechcrunch2011.files.wordpress.com/2011/08/screen-shot-2011-08-13-at-6-43-20-pm1.png?w=620&amp;h=393\" alt title=\"Screen Shot 2011-08-13 at 6.43.20 PM\" width=\"620\" height=\"393\" class=\"alignnone size-full wp-image-406259\">",
"href": "http://tctechcrunch2011.files.wordpress.com/2011/08/screen-shot-2011-08-13-at-6-43-20-pm1.png"
}
]
Expand Down
2 changes: 1 addition & 1 deletion lib/extractor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/extractor.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ module.exports =
# Grab the publisher of the page/site
publisher: (doc) ->
publisherCandidates = doc("meta[property='og:site_name'], \
meta[itemprop=name], \
meta[name='dc.publisher'], \
meta[name='DC.publisher'], \
meta[name='DC.Publisher']")
Expand Down
4 changes: 4 additions & 0 deletions test/extractor.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ suite 'Extractor', ->
publisher = extractor.publisher(doc)
eq publisher, "Polygon"

doc2 = cheerio.load("<html><head><meta itemProp=\"name\" content=\"The New York Times\"></head></html>")
publisher2 = extractor.publisher(doc2)
eq publisher2, "The New York Times"

test 'returns nothing if publisher eq "null"', ->
doc = cheerio.load("<html><head><meta property=\"og:site_name\" content=\"null\" /></head></html>")
publisher = extractor.publisher(doc)
Expand Down