translator question for a sites that require a form

18 views
Skip to first unread message

h.em65

unread,
Jan 29, 2017, 5:45:00 AM1/29/17
to zotero-dev
Hi 

How can I deal with sites that require a form to be submitted when writing json test cases for translators?


thanks

Sebastian Karcher

unread,
Jan 29, 2017, 9:00:30 AM1/29/17
to zoter...@googlegroups.com
It depends on the details, but usually forms are submitted using a POST
request, which you can use in translators with ZU.doPost.
Basic documentation here:
https://www.zotero.org/support/dev/translators/coding#batch_saving
Examples e.g. in the Sage or Wiley translators

hth,
Sebastian
> --
> You received this message because you are subscribed to the Google
> Groups "zotero-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to zotero-dev+...@googlegroups.com
> <mailto:zotero-dev+...@googlegroups.com>.
> To post to this group, send email to zoter...@googlegroups.com
> <mailto:zoter...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/zotero-dev.
> For more options, visit https://groups.google.com/d/optout.


Hanieh Emami

unread,
Feb 1, 2017, 3:10:48 AM2/1/17
to zoter...@googlegroups.com
Hello, 

Thanks for the response, but I'm still not sure how can I instruct the TEST RUNNER (Provo) to submit a form (send a POST request) rather than sending a GET request when writing TEST CASES for translators.
To be more clear, I'm trying to write some test cases for a translator targeting a website that posts back all queries to a single URL.
That said, unlike the translators you mentioned, it's not possible to build a URL directly pointing to the page I want to extract metadata from. So instead of specifying URLs with QueryString parameters, I'm looking for a way to send some predefined form encoded data to a specific URL for each test case item.

Any help is much appreciated



 Sent with Mailtrack

On Sun, Jan 29, 2017 at 5:30 PM, Sebastian Karcher <bst...@gmx.de> wrote:
It depends on the details, but usually forms are submitted using a POST
request, which you can use in translators with ZU.doPost.
Basic documentation here:
https://www.zotero.org/support/dev/translators/coding#batch_saving
Examples e.g. in the Sage or Wiley translators

hth,
Sebastian

On 01/29/2017 05:22 AM, h.em65 wrote:
> Hi
>
> How can I deal with sites that require a form to be submitted when
> writing json test cases for translators?
>
>
> thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "zotero-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send

> To post to this group, send email to zoter...@googlegroups.com
> Visit this group at https://groups.google.com/group/zotero-dev.
> For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+unsubscribe@googlegroups.com.
To post to this group, send email to zoter...@googlegroups.com.



--
Best regards
hanie...@gmail.com , Hanieh Emami

Philipp Zumstein

unread,
Feb 1, 2017, 6:16:39 AM2/1/17
to zoter...@googlegroups.com
The test cases in the translators are always GET request and I don't see any way to do the same with a POST request. You could save the output as a comment and describe how to search maybe?



> To post to this group, send email to zoter...@googlegroups.com
> <mailto:zotero-dev@googlegroups.com>.
> Visit this group at https://groups.google.com/group/zotero-dev.
> For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+unsubscribe@googlegroups.com.
To post to this group, send email to zoter...@googlegroups.com.
Visit this group at https://groups.google.com/group/zotero-dev.
For more options, visit https://groups.google.com/d/optout.

--
Best regards
hanie...@gmail.com , Hanieh Emami

Sebastian Karcher

unread,
Feb 1, 2017, 8:28:56 AM2/1/17
to zoter...@googlegroups.com
Sorry, I misread your question. Just to be clear, what Philipp is saying
is that you currently can't write automated tests for sites that don't
have permanent URLs for individual items (and while I think it'd be
technically possible, I don't think we have any immediate plans to
implement it). Adding the JSON output in a comment is a nice way to give
later coders a sense of what the translator produced, but it's not
something we'd require for a submission.

On 02/01/2017 03:10 AM, Hanieh Emami wrote:
> Hello,
>
> Thanks for the response, but I'm still not sure how can I instruct the
> TEST RUNNER (Provo) to submit a form (send a POST request) rather than
> sending a GET request when writing TEST CASES for translators.
> To be more clear, I'm trying to write some test cases for a translator
> targeting a website that posts back all queries to a single URL.
> That said, unlike the translators you mentioned, it's not possible to
> build a URL directly pointing to the page I want to extract metadata
> from. So instead of specifying URLs with QueryString parameters, I'm
> looking for a way to send some predefined form encoded data to a
> specific URL for each test case item.
>
> Any help is much appreciated
>
>
>
>
> <https://mailtrack.io/trace/link/c3ae263780f4e1d03ee546fcfc01633fc8c2e389?url=https%3A%2F%2Fmailtrack.io%2F&signature=3ee74be4e6a8926a>Sent
> with Mailtrack
> <https://mailtrack.io/install?source=signature&lang=en&referral=hanie...@gmail.com&idSignature=22>
>
> On Sun, Jan 29, 2017 at 5:30 PM, Sebastian Karcher <bst...@gmx.de
> <mailto:bst...@gmx.de>> wrote:
>
> It depends on the details, but usually forms are submitted using a
> POST
> request, which you can use in translators with ZU.doPost.
> Basic documentation here:
> https://www.zotero.org/support/dev/translators/coding#batch_saving
> <https://www.zotero.org/support/dev/translators/coding#batch_saving>
> Examples e.g. in the Sage or Wiley translators
>
> hth,
> Sebastian
>
> On 01/29/2017 05:22 AM, h.em65 wrote:
> > Hi
> >
> > How can I deal with sites that require a form to be submitted when
> > writing json test cases for translators?
> >
> >
> > thanks
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "zotero-dev" group.
> > To unsubscribe from this group and stop receiving emails from
> it, send
> > an email to zotero-dev+...@googlegroups.com
> <mailto:zotero-dev%2Bunsu...@googlegroups.com>
> > <mailto:zotero-dev+...@googlegroups.com
> <mailto:zotero-dev%2Bunsu...@googlegroups.com>>.
> > To post to this group, send email to zoter...@googlegroups.com <mailto:zoter...@googlegroups.com>
> > <mailto:zoter...@googlegroups.com
> <mailto:zoter...@googlegroups.com>>.
> <https://groups.google.com/group/zotero-dev>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "zotero-dev" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to zotero-dev+...@googlegroups.com
> <mailto:zotero-dev%2Bunsu...@googlegroups.com>.
> To post to this group, send email to zoter...@googlegroups.com
> <mailto:zoter...@googlegroups.com>.
> <https://groups.google.com/group/zotero-dev>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
>
>
> --
> Best regards
> hanie...@gmail.com <mailto:hanie...@gmail.com> , Hanieh Emami
> --
> You received this message because you are subscribed to the Google
> Groups "zotero-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to zotero-dev+...@googlegroups.com
> <mailto:zotero-dev+...@googlegroups.com>.
> To post to this group, send email to zoter...@googlegroups.com
> <mailto:zoter...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages