Examples: Cite with EasyBib forms

Example 1: Export to EasyBib

Organization has a lot of book listings available, and it wants to allow users of its site to cite books. It decides to add an “export to EasyBib” button to its different books.

To implement this feature, they can create a <form> next to each one of their books that contains the citation data, formatted for EasyBib export.

The first step is to create the JSON citation string. It looks like this:

{
    "source": "<b>book</b>",
    "pubtype": {
        "main": "<b>pubnonperiodical</b>"
    },
    "pubnonperiodical": {
        "title": "The Catcher in the Rye",
        "publisher": "Little, Brown",
        "city": "Boston",
        "year": "1951"
    },
    "contributors": [
        {
            "function": "author",
            "first": "Jerome",
            "middle": "David",
            "last": "Salinger"
        }
    ]
}

Note: Bold text is for values that can be, but should not be, changed if you have the exact needs of this case study. The other values should be changed to match the specific data of your source.

The next step is to URL encode the string, and put it into a hidden field named ‘data’. At the end, the full form looks like this:

&lt;form action="http://www.easybib.com/cite/form" method="POST"&gt;
  &lt;input name="data" type="hidden" value="%7B%22source%22%3A%22book%22%2C%22pubtype%22%3A%7B%22main%22%3A%22pubnonperiodical%22%7D%2C%22pubnonperiodical%22%3A%7B%22title%22%3A%22The+Catcher+in+the+Rye%22%2C%22publisher%22%3A%22Little%2C+Brown%22%2C%22city%22%3A%22Boston%22%2C%22year%22%3A%221951%22%7D%2C%22contributors%22%3A%5B%7B%22function%22%3A%22author%22%2C%22first%22%3A%22Jerome%22%2C%22middle%22%3A%22David%22%2C%22last%22%3A%22Salinger%22%7D%5D%7D" /&gt;
  &lt;input type="submit" value="Cite on EasyBib!" /&gt;
&lt;/form&gt;

Example 2: Export databases to EasyBib

An electronic database has a number of journal articles that subscribers access. It wants to add citation capabilities to its site, so decides to add an “Export to EasyBib” button. They want to make sure their database information also is appended to the citation.

{
    "source": "<b>journal</b>",
    "journal": {
        "title": "Industry structure, market rivalry, and public policy"
    },
    "pubtype": {
        "main": "<b>pubjournal</b>",
        "suffix": "<b>pubdatabase</b>"
    },
    "pubjournal": {
        "title": "Journal of Law and Economics",
        "volume": "16",
        "issue": "1",
        "year": "1973",
        "start": "1",
        "end": "9"
    },
    "contributors": [
        {
            "function": "author",
            "first": "Harold",
            "last": "Demsetz"
        }
    ],
    "pubdatabase": {
        "service": "Company name",
        "db": "Specific database name",
        "searchtext": "http://www.url.com/article?id=321424",
        "day": "3",
        "month": "march",
        "year": "2002",
        "dayaccessed": "10",
        "monthaccessed": "april",
        "yearaccessed": "2010"
    }
}

Note: Bold text is for values that can be, but should not be, changed if you have the exact needs of this case study. The other values should be changed to match the specific data of your source.

The next step is to URL encode the string, and put it into a hidden field named ‘data’. At the end, the full form looks like this:

&lt;form action="http://www.easybib.com/cite/form" method="POST"&gt;
  &lt;input name="data" type="hidden" value="%7B%22source%22%3A%22journal%22%2C%22journal%22%3A%7B%22title%22%3A%22Industry+structure%2C+market+rivalry%2C+and+public+policy%22%7D%2C%22pubtype%22%3A%7B%22main%22%3A%22pubjournal%22%2C+%22suffix%22%3A%22pubdatabase%22%7D%2C%22pubjournal%22%3A%7B%22title%22%3A%22Journal+of+Law+and+Economics%22%2C%22volume%22%3A%2216%22%2C%22issue%22%3A%221%22%2C%22year%22%3A%221973%22%2C%22start%22%3A%221%22%2C%22end%22%3A%229%22%7D%2C%22contributors%22%3A%5B%7B%22function%22%3A%22author%22%2C%22first%22%3A%22Harold%22%2C%22last%22%3A%22Demsetz%22%7D%5D%2C%22pubdatabase%22%3A%7B%22service%22%3A%22Company+name%22%2C+%22db%22%3A%22Specific+database+name%22%2C%22searchtext%22%3A%22http%3A%2F%2Fwww.url.com%2Farticle%3Fid%3D321424%22%2C%22day%22%3A%223%22%2C%22month%22%3A%22march%22%2C%22year%22%3A%222002%22%2C%22dayaccessed%22%3A%2210%22%2C%22monthaccessed%22%3A%22april%22%2C%22yearaccessed%22 %3A%222010%22%7D%7D" /&gt;
  &lt;input type="submit" value="Cite on EasyBib!" /&gt;
&lt;/form&gt;

To implement this feature, they can create a <form> next to each one of their journal articles that contains the citation data, formatted for EasyBib export.