Skip to content

Instantly share code, notes, and snippets.

View abhididdigi's full-sized avatar
🔥

Abhiram Diddigi abhididdigi

🔥
View GitHub Profile
// Make a call to GlideRecordUtil and get the entire current object.
var gru = Packages.com.glide.script.GlideRecordUtil.get(current);
//Invoke the function called getChangedFieldNames();
var fieldsChangedList = gru.getChangedFieldNames();
// One important thing to note is that, the object thats here is a Java object, so we will now use j2js to convert it into a
// Javascript Array.
import requests;
from bs4 import BeautifulSoup
list_of_url = [];
def read_ghantasala():
url = 'http://ghantasala.info/allsongs/';
r = requests.get(url);
soup = BeautifulSoup(r.text);
for link in soup.find_all('a'):
if(link.get('href').find('mp3') > -1):
def smoothPalindrome(string):
count =0;
dic = {c:string.count(c) for c in string};
i=0;
while i < len(string):
if(string[i] != string[len(string)-1-i]):
@abhididdigi
abhididdigi / processOutputJSONwithnode.js
Created August 4, 2013 17:10
Process the output.JSON with node.js.
var _ = require('underscore')._;
fs = require('fs')
fs.readFile('Output.json', 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
var data = JSON.parse(data);
var filteredJSON = _.uniq(data,false,function(d){return d.name})
var tags = {};
import re
class ProcessMovieName:
# 1 > we substring them, for the year. So incase if the string contains
# any of the year mentioned, then it truncates it.
listOfYears = range(1900,2020) # So i don't have to bother till 2020, instead
# we could just set the current year too.
processedName ='';
def cleanName(self,name):
pattern = re.compile('[()\[\]]')
name = pattern.sub('',name);
@abhididdigi
abhididdigi / CallIMDB.py
Created August 4, 2013 16:48
This is the entry point of the entire Movie scraping movies.
import os
from ProcessMovieName import ProcessMovieName
from stack import custom_stack
from IMDBCall import IMDBCall
import json
#for making calls to IMDB
imdbcall = IMDBCall();
#Custom stack implementation for easiness.
stack = custom_stack();
@abhididdigi
abhididdigi / IMDBCall.py
Last active May 18, 2023 19:21
A call to IMDB API for getting the Movie information. If there is an exact match, then it returns HTML. So scrape it, and get the details.
import httplib2
import urllib
from bs4 import BeautifulSoup
import ast
import json
import re
class IMDBCall:
''' This class gets JSON output for every search of IMDB API.
@abhididdigi
abhididdigi / JSUtil2.js
Last active March 12, 2020 22:55
This is the entire JSUtil2 script. Creating a gist, to show it on Service Now diary.com
/*
* JSUtil already has some utility functions, Some more utility functions.
* Written by [email protected]
* Re-written for Service Now from underscore.js: http://underscorejs.org/
*
*/
var JSUtil2 = Class.create();