Craigslist Extension

Would love to get a CL extension. Thanks!

Hi, welcome to the forum. Here’s a snippet for this. Use your mouse to select the text block below, then click Install Extension when PopClip appears:

#popclip
name: Craigslist Search
icon: search filled C
url: https://{popclip option site}.craigslist.org/search/sss?query=***
options: [{identifier: site, type: string, label: Subdomain}]

In the Subdomain option field, type the first part of the domain for the local site, eg nyc, coventry or whatever.

This works perfectly. I greatly appreciate it. Thanks Nick!!

thank you but please give me example for Option for new york for sale subdomain, what exactly I have to wright?

new york for sale - craigslist

→ newyork

Thank you it works now !!!

Could you tell me please, how can I convert an extension form “.popclipextz” to something like this:

#popclip
name: Craigslist Search
icon: search filled C
url: https://{popclip option site}.craigslist.org/search/sss?query=***
options: [{identifier: site, type: string, label: Subdomain}]

Im just wondering to look inside for some extension for learning purpose

1 Like
  1. Rename .popclipextz file to .zip
  2. Unzip to reveal .popclipext
  3. Right click and “show package contents”
  4. Look at Config.plist Config.json with text editor

CleanShot 2023-05-24 at 07.09.49

Most of the older extensions are in the “plist” format. It looks different to the #popclip ... etc. snippet but it is actually the same thing just in a different format and with extra stuff.

Here’s the Config.plist for urban dictionary:

In fact a lot of these fields are just for the website (to display the credits and website link) and are not needed for the extension itself. Here it is again removing most the unnecessary fields:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Actions</key>
	<array>
		<dict>
			<key>Regular Expression</key>
            <string>(?s)^.{1,200}$</string>
			<key>URL</key>
            <string>http://www.urbandictionary.com/define.php?term={popclip text}</string>
		</dict>
	</array>
	<key>Extension Name</key>
	<string>Urban Dictionary</string>
</dict>
</plist>

Furthermore since there is only one Action, it doesn’t need to be wrapped in an array. Also the Regular Expression is only used for filtering input length so is really optional. So this can again be further simplified to

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>URL</key>
  <string>http://www.urbandictionary.com/define.php?term={popclip text}</string>
  <key>Extension Name</key>
  <string>Urban Dictionary</string>
</dict>
</plist>

This can be rewritten in YAML like this:

URL: http://www.urbandictionary.com/define.php?term={popclip text}
Extension Name: Urban Dictionary

Finally I can put #popclip at the top and make sure the extension name comes first (because that is required):

#popclip
Extension Name: Urban Dictionary
URL: http://www.urbandictionary.com/define.php?term={popclip text}

And that’s a working PopClip snippet.

A further optional refinement is to rename Extension Name: to just name: and replace {popclip text} with ***. These changes I made to support more brief and easy to write snippets. But the old ways still work too.

#popclip
name: Urban Dictionary
URL: http://www.urbandictionary.com/define.php?term=***

Further technical info at https://github.com/pilotmoon/PopClip-Extensions.

1 Like

Thank you very much for such an informative respond !!!