开发者

Using Drupal to do what Digg Does

开发者 https://www.devze.com 2023-02-15 01:39 出处:网络
I\'m trying to create a site where, like Digg, a user can submit a link and using ajax it attempts to pull the metadata from the page into a title and description field.The user can change either of t

I'm trying to create a site where, like Digg, a user can submit a link and using ajax it attempts to pull the metadata from the page into a title and description field. The user can change either of these fields then submit the content.

Ideally a module already exist开发者_开发问答s. I tried playing around with Feeds, but I'm not sure if I'm looking in the right place.

I probably have to create my own custom module.

Any suggestions? Can I tap into the Feeds API just to parse the url then take the results and do all the mapping myself? Assuming I want to create my own form and bring in my own ajax.


You could probably do that with Feeds, but I think it might be overkill and could be difficult to configure.

You could do what you're looking for in a relatively small custom module using hook_form_alter to customize the submission form, arg() to determine the URL being submitted, drupal_http_request to retrieve the page, then the Form API's #default_value setting to pre-populate the field(s).

The Prepopulate module does a lot of what you're looking for. If it provides hooks (I'm not sure if it does) all you would need to do is add the drupal_http_request, to handle fetching the metadata.


In Drupal it's called Drigg ;). It is supposed to a nice Drupal module to get the functionality of Digg. It will be worth a try I suppose.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号