Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace scala-uri library from ExtractDomain. #524

Merged
merged 1 commit into from
Nov 1, 2021
Merged

Conversation

ruebot
Copy link
Member

@ruebot ruebot commented Nov 1, 2021

GitHub issue(s): #521

What does this Pull Request do?

Replace scala-uri library from ExtractDomain.

How should this be tested?

  • GitHub actions
  • Tested on tuna too:
import io.archivesunleashed._
import io.archivesunleashed.udfs._
import io.archivesunleashed.app._

val webpages = RecordLoader.loadArchives("/tuna1/scratch/nruest/5467/warcs/gzip/*", sc).webpages()

val domain_count = webpages.groupBy(removePrefixWWW(extractDomain($"Url")).alias("url")).count().sort($"count".desc)

domain_count.show(false)
+------------------------+-----+                                                
|url                     |count|
+------------------------+-----+
|bbc.com                 |57707|
|bbc.co.uk               |36096|
|winnipegfreepress.com   |25258|
|cbc.ca                  |3755 |
|1winnipeg.ca            |1881 |
|ctvnews.ca              |1377 |
|twitter.com             |1347 |
|macleans.ca             |964  |
|youtube.com             |728  |
|huffingtonpost.ca       |403  |
|communitynewscommons.org|201  |
|soundcloud.com          |137  |
|huffingtonpost.com      |72   |
|globalnews.ca           |67   |
|doubleclick.net         |66   |
|google.com              |58   |
|metronews.ca            |52   |
|livestream.com          |46   |
|workopolis.com          |41   |
|vancouvertrails.com     |25   |
+------------------------+-----+
only showing top 20 rows

h/t @helgeho for implementing this on ARCH 🙏

- Pull down public_suffix_list.dat, and parse it to ExtractDomain
  instead of using scala-uri
- Remove scala-uri
- Remove cats shading
- Resolves #521
@ianmilligan1 ianmilligan1 merged commit f2b4379 into main Nov 1, 2021
@ianmilligan1 ianmilligan1 deleted the issue-521 branch November 1, 2021 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace scala-uri library from ExtractDomain and just parse public_suffix_list.dat
2 participants