function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anil MeghnathiAnil Meghnathi 

Restrict user in chatter from posting link for adult youtube video

Ho i can restrict user in chatter from posting link for adult youtube video?

 

Any idea??

 

Thanks 

Anil

Best Answer chosen by Admin (Salesforce Developers) 
ak1234ak1234

 i am also wondering for that but i have notice the functionality of youtube link,

 

http://www.youtube.com/watch?v=ABCXYZ

 

see there is unique ID for each video in youtube i.e., v=ABCXYZ.

 

so is there any api to filter that video link to restrict to post on chatter??

 

Thanks,

Axay

All Answers

Jia HuJia Hu
You have to create two triggers on FeedItem and FeedComment each, to filter each post,...

see the example
Recipe 11: Monitor specific keywords on an entity feed
http://wiki.developerforce.com/page/Chatter_Code_Recipes
Anil MeghnathiAnil Meghnathi
trigger CheckChatterPostsOnOpportunity on FeedItem (before insert) {
02    //Get the key prefix for the Opportunity object via a describe call.
03    String oppKeyPrefix = Opportunity.sObjectType.getDescribe().getKeyPrefix();
04     
05    for (FeedItem f: trigger.new)
06    {
07        String parentId = f.parentId;
08        //We compare the start of the 'parentID' field to the Opportunity key prefix to
09        //restrict the trigger to act on posts made to the Opportunity object.
10        if (parentId.startsWith(oppKeyPrefix) &&
11            f.Body == '!close')
12        {           
13            //Add business logic here
14        }
15    }
16

}

This is good.we can monitor keywords of feeditem but how i can come to know that this link is for adult video.Because from only text of link its difficult to decide whether it is link for adult video or not?

If you have any ideo please share with me. Thanks

 

Anil

ak1234ak1234

 i am also wondering for that but i have notice the functionality of youtube link,

 

http://www.youtube.com/watch?v=ABCXYZ

 

see there is unique ID for each video in youtube i.e., v=ABCXYZ.

 

so is there any api to filter that video link to restrict to post on chatter??

 

Thanks,

Axay

This was selected as the best answer