Skip to content
Snippets Groups Projects
Commit 6153a1ff authored by Mathieu Loiseau's avatar Mathieu Loiseau
Browse files

logo

parent aaee5657
No related branches found
No related tags found
No related merge requests found
...@@ -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 into a mediawiki instance
License: MIT License: MIT
Encoding: UTF-8 Encoding: UTF-8
LazyData: true LazyData: true
......
...@@ -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)
}) })
% 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)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment