Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mediawikiR
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mathieu Loiseau
mediawikiR
Commits
6153a1ff
Commit
6153a1ff
authored
7 years ago
by
Mathieu Loiseau
Browse files
Options
Downloads
Patches
Plain Diff
logo
parent
aaee5657
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
DESCRIPTION
+1
-1
1 addition, 1 deletion
DESCRIPTION
R/class.R
+11
-2
11 additions, 2 deletions
R/class.R
man/connect-Mediawikir-method.Rd
+12
-0
12 additions, 0 deletions
man/connect-Mediawikir-method.Rd
with
24 additions
and
3 deletions
DESCRIPTION
+
1
−
1
View file @
6153a1ff
...
@@ -4,7 +4,7 @@ Title: Connects to a mediawiki instance and writes in it what you want
...
@@ -4,7 +4,7 @@ Title: Connects to a mediawiki instance and writes in it what you want
Version: 0.1.0
Version: 0.1.0
Author: Mathieu Loiseau
Author: Mathieu Loiseau
Maintainer: Mathieu Loiseau <loiseaum@univ-grenoble-alpes.fr>
Maintainer: Mathieu Loiseau <loiseaum@univ-grenoble-alpes.fr>
Description: It can be used to post the output of an R script directly to a mediawiki instance
Description: It can be used to post the output of an R script directly
in
to a mediawiki instance
License: MIT
License: MIT
Encoding: UTF-8
Encoding: UTF-8
LazyData: true
LazyData: true
...
...
This diff is collapsed.
Click to expand it.
R/class.R
+
11
−
2
View file @
6153a1ff
...
@@ -2,7 +2,15 @@
...
@@ -2,7 +2,15 @@
#'
#'
#'@slot url the mediawiki instance base url
#'@slot url the mediawiki instance base url
#'@slot auth_token the current token used to edit the wiki (cf. https://www.mediawiki.org/wiki/Manual:Edit_token)
#'@slot auth_token the current token used to edit the wiki (cf. https://www.mediawiki.org/wiki/Manual:Edit_token)
setClass
(
"Mediawikir"
,
representation
(
url
=
"character"
,
auth_token
=
"character"
))
setClass
(
"Mediawikir"
,
representation
(
url
=
"character"
,
user_name
=
"character"
,
auth_token
=
"character"
))
setGeneric
(
"connect"
,
function
(
.Object
,
pass
){})
#'Connects to mediawiki instance and gets token (to be called by constructor)
#'
setMethod
(
"connect"
,
"Mediawikir"
,
function
(
.Object
,
pass
){
library
(
"RCurl"
)
paste
(
"connecting : "
,
.Object
@
user_name
,
"/"
,
pass
)
})
#'Creates a new Mediawikir object instance
#'Creates a new Mediawikir object instance
#'
#'
...
@@ -13,6 +21,7 @@ setClass("Mediawikir", representation(url = "character", auth_token = "character
...
@@ -13,6 +21,7 @@ setClass("Mediawikir", representation(url = "character", auth_token = "character
#' new("Mediawikir", "http://wiki.example.com", "admin", "theadmin'spassword")
#' new("Mediawikir", "http://wiki.example.com", "admin", "theadmin'spassword")
setMethod
(
"initialize"
,
"Mediawikir"
,
function
(
.Object
,
instance_url
,
user
,
pass
){
setMethod
(
"initialize"
,
"Mediawikir"
,
function
(
.Object
,
instance_url
,
user
,
pass
){
.Object
@
url
<-
instance_url
.Object
@
url
<-
instance_url
.Object
@
auth_token
<-
paste
(
user
,
pass
,
sep
=
" / "
)
.Object
@
user_name
<-
user
.Object
@
auth_token
<-
connect
(
.Object
,
pass
)
return
(
.Object
)
return
(
.Object
)
})
})
This diff is collapsed.
Click to expand it.
man/connect-Mediawikir-method.Rd
0 → 100644
+
12
−
0
View file @
6153a1ff
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/class.R
\docType{methods}
\name{connect,Mediawikir-method}
\alias{connect,Mediawikir-method}
\title{Connects to mediawiki instance and gets token (to be called by constructor)}
\usage{
\S4method{connect}{Mediawikir}(.Object, pass)
}
\description{
Connects to mediawiki instance and gets token (to be called by constructor)
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment