Browse Source

Edit: recompiled PDF, extract hashtags, write TODO

janwey 1 year ago
parent
commit
bd86de5581
3 changed files with 84 additions and 0 deletions
  1. BIN
      docs/collector.pdf
  2. 82
    0
      plotte.R
  3. 2
    0
      todo.txt

BIN
docs/collector.pdf View File


+ 82
- 0
plotte.R View File

@@ -0,0 +1,82 @@
1
+################################################################################
2
+# plotte.R                                                                     #
3
+# Plotting scraped data for "I Love Free Software Day"                         #
4
+# Jan Weymeirsch janwey@fsfe.org                                               #
5
+################################################################################
6
+
7
+## Loading Data {{{ ----
8
+load(file = "./data/ilovefs-all_2018-02-14_16-39-12.RData")
9
+# }}}
10
+
11
+##
12
+### Extract Hashtags
13
+#### Fediverse
14
+mastodon_hashtags_l <- stri_extract_all(str = mastodon$text, regex = "#\\w+")
15
+mastodon_hashtags <- c()
16
+for(i in c(1:length(mastodon_hashtags_l))){
17
+  for(j in c(1:length(mastodon_hashtags_l[[i]]))){
18
+    mastodon_hashtags <- c(mastodon_hashtags, mastodon_hashtags_l[[i]][j])
19
+  }
20
+}
21
+unique(mastodon_hashtags)
22
+
23
+#### Twitter
24
+twitter_hashtags_l <- stri_extract_all(str = twitter$text, regex = "#\\w+")
25
+twitter_hashtags <- c()
26
+for(i in c(1:length(twitter_hashtags_l))){
27
+  for(j in c(1:length(twitter_hashtags_l[[i]]))){
28
+    twitter_hashtags <- c(twitter_hashtags, twitter_hashtags_l[[i]][j])
29
+  }
30
+}
31
+unique(twitter_hashtags)
32
+
33
+plot(mastodon$acct)
34
+legend(x = "topleft", legend = unique(mastodon$acct))
35
+mastodon$text[mastodon$acct == "JayVii_de"]
36
+length(which(mastodon$acct == "mxmehl@quitter.no"))
37
+
38
+mastodon$text
39
+mastodon_projects <- c("astroidmail",
40
+		       "general",
41
+		       "astroidmail",
42
+		       "general",
43
+		       "general",
44
+		       "general",
45
+		       "general",
46
+		       "general",
47
+		       "general",
48
+		       "general",
49
+		       "general",
50
+		       "opensourcedesign",
51
+		       "general",
52
+		       "general",
53
+		       "general",
54
+		       "general",
55
+		       "general",
56
+		       "general",
57
+		       "general",
58
+		       "general",
59
+		       "general",
60
+		       "general",
61
+		       "general",
62
+		       "general",
63
+		       "general",
64
+		       "general",
65
+		       "general",
66
+		       NA,
67
+		       "general",
68
+		       "general",
69
+		       NA,
70
+		       NA,
71
+		       NA,
72
+		       NA,
73
+		       NA,
74
+		       "fdroid",
75
+		       "fdroid",
76
+		       NA,
77
+		       "transportr",
78
+		       "transportr",
79
+		       NA,
80
+		       "nextcloud")
81
+length(mastodon_projects)
82
+plot(as.factor(mastodon_projects))

+ 2
- 0
todo.txt View File

@@ -0,0 +1,2 @@
1
+# TODO
2
+- replace regex of date/time in collecto.R with strptime() https://stackoverflow.com/questions/15838548/parsing-iso8601-date-and-time-format-in-r

Loading…
Cancel
Save