Comments (12)
It already does do direct input.
from achecker.
I meant the webservice. According to the docs, it needs an URI and I don't see a way to enter just content?
achecker.ca/documentation/web_service_api.php
from achecker.
You might take a look at the TinyMCE plugin, which kind of does that.
https://github.com/atutor/acheck_plugin_tmce
There's no plans though, for direct input via Webservices. It might be a good project for a community member to take on ;-)
from achecker.
Hi, thanks for the info. I've tried implementing the same logics, but I cannot get it to work. I'm using PHP instead of JavaScript. I'm trying to implement the checker in a Drupal module, and I'm using this code:
$url = 'http://achecker.ca/checker/index.php';
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
$data = array(
'gid[]' => '8',
'validate_content' => urlencode('<h1>This is a test</h1>'),
);
$response = drupal_http_request($url, $headers, 'POST', http_build_query($data, '', '&'));
Just like here: http://drupal.org/node/221136
I do get a response, but that response just seems to be the HTML of the page, as if it never received input.
Any thoughts on how I could get this to work?
from achecker.
If you want to take this to the atutor.ca forums, I'll pass you on to Cindy Li, who created the Webservices
http://atutor.ca/forum/18/1.html
from achecker.
I'm more that willing to do that. However, I can't create an account on the forums. I've tried 4 different usernames, but all seem to be taken (can't believe that, I've tried some random strings).
I there another way to contact Cindy Li?
from achecker.
We had some problems on the atutor.ca server this weekend. I've made a few adjustments, and hoping things are working now.
You can try again.
https://atutor.ca/my/register.php
from achecker.
Thanks for pumping in ideas and looking into code.
To achieve what you need, AChecker server side needs to be adjusted to accept the direct html content to be validated. With the current web service implementation:
https://github.com/atutor/AChecker/blob/master/checkacc.php#L48-56
The only valid input is URIs. However, extending AChecker to accommodate direct input should not be hard.
from achecker.
Thanks Cindy for your reply. Implementing this seems rather simple. Is this something you can/will do? Or do you want me to Fork the module and implement it myself?
from achecker.
Hi BarisW, it might be a while before we do another round of work on achecker. It would get done faster if you wanted to take it on.
from achecker.
BarisW, this might get you started. Its a diff of checkacc.php. Theres not much to it.
@@ -35,6 +35,7 @@
include_once(AC_INCLUDE_PATH. 'classes/RESTWebServiceOutput.class.php');
$uri = trim(urldecode($_REQUEST['uri']));
+$validate_content = trim(urldecode($_REQUEST['html']));
$web_service_id = trim($_REQUEST['id']);
$guide = trim(strtolower($_REQUEST['guide']));
$output = trim(strtolower($_REQUEST['output']));
@@ -46,11 +47,11 @@
// end of initialization
// validate parameters
-if ($uri == '')
+if ($uri == '' && $validate_content == '')
{
$errors[] = 'AC_ERROR_EMPTY_URI';
}
-else
+else if (empty($validate_content))
{
if (Utility::getValidURI($uri) === false) $errors[] = 'AC_ERROR_INVALID_URI';
}
@@ -106,7 +107,9 @@
$userLinksDAO->setLastSessionID($user_link_id, Utility::getSessionID());
// validating uri content
+if (empty($validate_content)) {
$validate_content = @file_get_contents($uri);
+}
if (isset($validate_content))
{
from achecker.
I've just added a pull request with this functionality also.
https://github.com/atutor/AChecker/pull/30
from achecker.
Related Issues (20)
- Input type=image bug HOT 2
- Best way to check entire site HOT 3
- Achecker css validator
- Install stalls when installing locally HOT 2
- False positive with inputs inside labels HOT 1
- Question on Licensing HOT 2
- Thank you HOT 3
- Password reset is broken
- config.inc.php not found HOT 3
- MariaDB not working HOT 7
- Getting AC_themes creation failed HOT 3
- Add URL to project HOT 7
- Issue with link contrast checking HOT 1
- Add a 'confirm all problems' button. HOT 1
- Achecker different results: local and on- line HOT 2
- [AChecker] uploading file problem HOT 5
- [Achecker]different result browser Chrome and Mozilla HOT 2
- Save Configuration Error
- [achecker] local 1.3 running with uploaded file: internet active/not active different results HOT 3
- (not a bug) Finally got this working wanted to share some gotchas for the noobs like me HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from achecker.