In this tutorial, we'll automate a simple process: searching text you highlight in Google Scholar.
We'll use this PBS page to develop our workflow. There is a video at the end of of this tutorial demonstrating what’s covered in the text.
1. Configure a Right-click Button
Open the Page Editor
The first time you open the Page Editor on a new webpage, you need to grant PixieBrix access to the page. You can grant permanent access by either:
- Clicking Grant Permanent Access, or
- Granting temporary access by clicking on the PixieBrix extension in the Chrome Extensions dropdown and then refreshing the page
Configure a Context Menu Item
- Click Add in the top left of the Page Editor and choose Context Menu, and + Create New Context Menu
- In the Title field, replace "Context Menu Item" with "%s - Google Scholar"
- To test your context menu configuration:
- Highlight Duke Ellington on the webpage
- Right click to expand the context menu. It should look like this
Configure Where the Context Menu Appears
- In the Sites field, click All URLs. This tells PixieBrix to show the context menu item on any webpage you visit
- Scroll down to the Advanced Configuration. In the Advanced Permission section, click All URLs. This gives PixieBrix access to a page without you first clicking the context menu
2. Search Google Scholar
Define Your Search Parameters
Next we'll figure out how to construct a search URL for Google Scholar.
In a separate tab, go to the Google Scholar homepage and search for "Louis Armstrong"
After you click "Enter" you will be taken to search results page, which has this URL:
Toward the end of the URL you will see
q=Louis+Armstrong. Google Scholar uses "q" as the search parameter.
Configure the Search
- We'll first need to add the “Open a tab” brick. Click the "Add Button"
- Search "open a tab" and choose it
- In the URL put
- Click Add a Property. Delete "property1" and replace it with "q", the search parameter we identified in the URL
- In the Value text box type
documentUrland information about the selected element. In our case
selectionTextwill provide the selected text
3. Test Your Search
To test your Search, highlight "Duke Ellington" in the PBS article, and click. A new tab should open to the following URL: https://scholar.google.com/scholar?q=Duke+Ellington. Click Save in the Page Editor, and try different searches on different web pages.